@aviaratech/ai-delivery 0.3.34 → 0.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +12 -206
- package/README.md +57 -506
- package/dist/agent.d.ts +0 -2
- package/dist/agent.js +76 -16
- package/dist/agent.js.map +7 -1
- package/dist/agentReadiness.test.js +73 -67
- package/dist/agentReadiness.test.js.map +7 -1
- package/dist/boardReconcile.test.js +1746 -0
- package/dist/boardReconcile.test.js.map +7 -0
- package/dist/build.test.js +130 -0
- package/dist/build.test.js.map +7 -0
- package/dist/callerErrors.test.js +105 -0
- package/dist/callerErrors.test.js.map +7 -0
- package/dist/cli.js +406 -485
- package/dist/cli.js.map +7 -1
- package/dist/cliResult.d.ts +2 -2
- package/dist/cliResult.js +42 -25
- package/dist/cliResult.js.map +7 -1
- package/dist/cliResult.test.js +434 -297
- package/dist/cliResult.test.js.map +7 -1
- package/dist/config/deliveryConfig.d.ts +320 -14
- package/dist/config/deliveryConfig.js +472 -385
- package/dist/config/deliveryConfig.js.map +7 -1
- package/dist/config/deliveryConfig.test.js +775 -584
- package/dist/config/deliveryConfig.test.js.map +7 -1
- package/dist/contributorChecks.test.js +1694 -916
- package/dist/contributorChecks.test.js.map +7 -1
- package/dist/currentConsumer.test.js +819 -737
- package/dist/currentConsumer.test.js.map +7 -1
- package/dist/currentTrackingScenario.test.js +499 -477
- package/dist/currentTrackingScenario.test.js.map +7 -1
- package/dist/delivery/common.js +160 -172
- package/dist/delivery/common.js.map +7 -1
- package/dist/delivery/delivery.test.js +509 -431
- package/dist/delivery/delivery.test.js.map +7 -1
- package/dist/delivery/evidence.d.ts +2 -2
- package/dist/delivery/evidence.js +133 -120
- package/dist/delivery/evidence.js.map +7 -1
- package/dist/delivery/index.js +7 -2
- package/dist/delivery/index.js.map +7 -1
- package/dist/delivery/legacy.js +65 -5
- package/dist/delivery/legacy.js.map +7 -1
- package/dist/delivery/policy.d.ts +10 -10
- package/dist/delivery/policy.js +211 -238
- package/dist/delivery/policy.js.map +7 -1
- package/dist/delivery/stage.d.ts +18 -18
- package/dist/delivery/stage.js +220 -235
- package/dist/delivery/stage.js.map +7 -1
- package/dist/deliveryBoard.d.ts +74 -0
- package/dist/deliveryBoard.js +644 -0
- package/dist/deliveryBoard.js.map +7 -0
- package/dist/deliveryBoard.test.d.ts +1 -0
- package/dist/deliveryBoard.test.js +649 -0
- package/dist/deliveryBoard.test.js.map +7 -0
- package/dist/deliveryHealth.test.js +179 -155
- package/dist/deliveryHealth.test.js.map +7 -1
- package/dist/dependencyCompatibility.test.js +154 -140
- package/dist/dependencyCompatibility.test.js.map +7 -1
- package/dist/directoryIndependent.test.js +417 -383
- package/dist/directoryIndependent.test.js.map +7 -1
- package/dist/dispatch.d.ts +17 -12
- package/dist/dispatch.js +330 -322
- package/dist/dispatch.js.map +7 -1
- package/dist/errors.d.ts +16 -3
- package/dist/errors.js +104 -82
- package/dist/errors.js.map +7 -1
- package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
- package/dist/fixtures/deliveryBoardReplay.js +617 -0
- package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
- package/dist/fixtures/discovery.d.ts +59 -19
- package/dist/fixtures/discovery.js +96 -90
- package/dist/fixtures/discovery.js.map +7 -1
- package/dist/fixtures/inertEntrypointChild.js +57 -56
- package/dist/fixtures/inertEntrypointChild.js.map +7 -1
- package/dist/fixtures/inertEntrypoints.d.ts +1 -1
- package/dist/fixtures/inertEntrypoints.js +321 -276
- package/dist/fixtures/inertEntrypoints.js.map +7 -1
- package/dist/fixtures/inertTarget.d.ts +78 -7
- package/dist/fixtures/inertTarget.js +769 -691
- package/dist/fixtures/inertTarget.js.map +7 -1
- package/dist/fixtures/issue63.d.ts +4 -3
- package/dist/fixtures/issue63.js +260 -274
- package/dist/fixtures/issue63.js.map +7 -1
- package/dist/fixtures/issueProjectItems.d.ts +20 -0
- package/dist/fixtures/issueProjectItems.js +15 -0
- package/dist/fixtures/issueProjectItems.js.map +7 -0
- package/dist/fixtures/readView.d.ts +120 -0
- package/dist/fixtures/readView.js +172 -0
- package/dist/fixtures/readView.js.map +7 -0
- package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
- package/dist/fixtures/recordedGitHubFlows.js +109 -0
- package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
- package/dist/genericCompatibility.test.js +64 -55
- package/dist/genericCompatibility.test.js.map +7 -1
- package/dist/git.js +73 -67
- package/dist/git.js.map +7 -1
- package/dist/gitProcess.d.ts +1 -1
- package/dist/gitProcess.js +58 -53
- package/dist/gitProcess.js.map +7 -1
- package/dist/github/client.d.ts +2 -2
- package/dist/github/client.js +484 -379
- package/dist/github/client.js.map +7 -1
- package/dist/github/commandIdentityPolicy.js +44 -51
- package/dist/github/commandIdentityPolicy.js.map +7 -1
- package/dist/github/discovery.d.ts +3 -0
- package/dist/github/discovery.js +197 -201
- package/dist/github/discovery.js.map +7 -1
- package/dist/github/discovery.test.js +223 -177
- package/dist/github/discovery.test.js.map +7 -1
- package/dist/github/issueHistory.d.ts +2 -2
- package/dist/github/issueHistory.js +117 -125
- package/dist/github/issueHistory.js.map +7 -1
- package/dist/github/machineAuth.d.ts +1 -1
- package/dist/github/machineAuth.js +126 -117
- package/dist/github/machineAuth.js.map +7 -1
- package/dist/github/machineAuth.test.js +755 -639
- package/dist/github/machineAuth.test.js.map +7 -1
- package/dist/github/nativeIssueMetadata.js +286 -273
- package/dist/github/nativeIssueMetadata.js.map +7 -1
- package/dist/github/projectDelivery.d.ts +53 -1
- package/dist/github/projectDelivery.js +623 -460
- package/dist/github/projectDelivery.js.map +7 -1
- package/dist/github/relationships.d.ts +5 -2
- package/dist/github/relationships.js +434 -333
- package/dist/github/relationships.js.map +7 -1
- package/dist/github/repo.d.ts +1 -0
- package/dist/github/repo.js +123 -96
- package/dist/github/repo.js.map +7 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +7 -1
- package/dist/issue.d.ts +103 -7
- package/dist/issue.js +2104 -1547
- package/dist/issue.js.map +7 -1
- package/dist/issue63History.test.js +40 -42
- package/dist/issue63History.test.js.map +7 -1
- package/dist/issue63Routes.test.js +154 -143
- package/dist/issue63Routes.test.js.map +7 -1
- package/dist/issueBatchUpdate.test.js +1004 -683
- package/dist/issueBatchUpdate.test.js.map +7 -1
- package/dist/issueBlockerGuard.test.js +262 -226
- package/dist/issueBlockerGuard.test.js.map +7 -1
- package/dist/issueContract.d.ts +23 -4
- package/dist/issueContract.js +416 -395
- package/dist/issueContract.js.map +7 -1
- package/dist/issueContract.test.d.ts +4 -3
- package/dist/issueContract.test.js +358 -321
- package/dist/issueContract.test.js.map +7 -1
- package/dist/issueDates.test.js +235 -233
- package/dist/issueDates.test.js.map +7 -1
- package/dist/issueInfoReadback.test.js +304 -190
- package/dist/issueInfoReadback.test.js.map +7 -1
- package/dist/issueIntake.test.js +1945 -1732
- package/dist/issueIntake.test.js.map +7 -1
- package/dist/issueJournal.d.ts +40 -19
- package/dist/issueJournal.js +229 -138
- package/dist/issueJournal.js.map +7 -1
- package/dist/issueJournal.test.js +605 -422
- package/dist/issueJournal.test.js.map +7 -1
- package/dist/issueRollup.test.d.ts +1 -0
- package/dist/issueRollup.test.js +476 -0
- package/dist/issueRollup.test.js.map +7 -0
- package/dist/issueTracking.test.js +1088 -593
- package/dist/issueTracking.test.js.map +7 -1
- package/dist/issueWriteRecovery.test.d.ts +1 -0
- package/dist/issueWriteRecovery.test.js +260 -0
- package/dist/issueWriteRecovery.test.js.map +7 -0
- package/dist/lifecycle.test.js +112 -441
- package/dist/lifecycle.test.js.map +7 -1
- package/dist/logger.js +80 -74
- package/dist/logger.js.map +7 -1
- package/dist/mcp/index.js +116 -90
- package/dist/mcp/index.js.map +7 -1
- package/dist/mcp/tools.d.ts +790 -220
- package/dist/mcp/tools.js +267 -333
- package/dist/mcp/tools.js.map +7 -1
- package/dist/pluginAuthProbe.js +63 -52
- package/dist/pluginAuthProbe.js.map +7 -1
- package/dist/pluginAuthProbe.test.js +85 -62
- package/dist/pluginAuthProbe.test.js.map +7 -1
- package/dist/pluginCredentials.test.js +282 -259
- package/dist/pluginCredentials.test.js.map +7 -1
- package/dist/pluginDoctor.test.js +653 -588
- package/dist/pluginDoctor.test.js.map +7 -1
- package/dist/pluginInstaller.d.ts +7 -5
- package/dist/pluginInstaller.js +1173 -1231
- package/dist/pluginInstaller.js.map +7 -1
- package/dist/pluginInstaller.test.js +1822 -1283
- package/dist/pluginInstaller.test.js.map +7 -1
- package/dist/pluginPackaging.test.js +485 -305
- package/dist/pluginPackaging.test.js.map +7 -1
- package/dist/pr.d.ts +132 -94
- package/dist/pr.js +1521 -1323
- package/dist/pr.js.map +7 -1
- package/dist/pr.test.js +1678 -632
- package/dist/pr.test.js.map +7 -1
- package/dist/prAssociation.test.js +2419 -1788
- package/dist/prAssociation.test.js.map +7 -1
- package/dist/prDispatch.test.js +150 -89
- package/dist/prDispatch.test.js.map +7 -1
- package/dist/readView.d.ts +183 -0
- package/dist/readView.js +217 -0
- package/dist/readView.js.map +7 -0
- package/dist/readView.test.d.ts +1 -0
- package/dist/readView.test.js +119 -0
- package/dist/readView.test.js.map +7 -0
- package/dist/releaseReconciliation.test.js +267 -288
- package/dist/releaseReconciliation.test.js.map +7 -1
- package/dist/releaseWorkflow.test.js +2493 -422
- package/dist/releaseWorkflow.test.js.map +7 -1
- package/dist/review.d.ts +738 -2
- package/dist/review.js +601 -348
- package/dist/review.js.map +7 -1
- package/dist/review.test.js +1218 -812
- package/dist/review.test.js.map +7 -1
- package/dist/reviewSubmit.test.d.ts +1 -0
- package/dist/reviewSubmit.test.js +747 -0
- package/dist/reviewSubmit.test.js.map +7 -0
- package/dist/services/agentReadinessService.js +42 -37
- package/dist/services/agentReadinessService.js.map +7 -1
- package/dist/services/blockerGuardService.js +188 -188
- package/dist/services/blockerGuardService.js.map +7 -1
- package/dist/services/boardReconcileService.d.ts +1204 -0
- package/dist/services/boardReconcileService.js +1445 -0
- package/dist/services/boardReconcileService.js.map +7 -0
- package/dist/services/deliveryAdmission.d.ts +2 -0
- package/dist/services/deliveryAdmission.js +129 -152
- package/dist/services/deliveryAdmission.js.map +7 -1
- package/dist/services/deliveryHealthService.js +197 -199
- package/dist/services/deliveryHealthService.js.map +7 -1
- package/dist/services/legacyIssueMigration.js +263 -277
- package/dist/services/legacyIssueMigration.js.map +7 -1
- package/dist/services/worktreeRegistry.d.ts +27 -119
- package/dist/services/worktreeRegistry.js +765 -1182
- package/dist/services/worktreeRegistry.js.map +7 -1
- package/dist/stagedChecks.test.js +396 -194
- package/dist/stagedChecks.test.js.map +7 -1
- package/dist/start.test.js +99 -95
- package/dist/start.test.js.map +7 -1
- package/dist/stdoutRegression.test.js +354 -350
- package/dist/stdoutRegression.test.js.map +7 -1
- package/dist/targetPolicyDiscovery.test.js +141 -143
- package/dist/targetPolicyDiscovery.test.js.map +7 -1
- package/dist/targetPolicyEntrypoints.test.js +308 -269
- package/dist/targetPolicyEntrypoints.test.js.map +7 -1
- package/dist/targetPolicyLocal.test.js +580 -1051
- package/dist/targetPolicyLocal.test.js.map +7 -1
- package/dist/targetPolicyRoutes.test.js +305 -281
- package/dist/targetPolicyRoutes.test.js.map +7 -1
- package/dist/targetRepositoryExecution.test.d.ts +1 -0
- package/dist/targetRepositoryExecution.test.js +463 -0
- package/dist/targetRepositoryExecution.test.js.map +7 -0
- package/dist/terminalMessages.js +41 -35
- package/dist/terminalMessages.js.map +7 -1
- package/dist/toolOutput.d.ts +2 -0
- package/dist/toolOutput.js +36 -0
- package/dist/toolOutput.js.map +7 -0
- package/dist/toolOutput.test.d.ts +1 -0
- package/dist/toolOutput.test.js +240 -0
- package/dist/toolOutput.test.js.map +7 -0
- package/dist/utils/atomicJson.js +84 -76
- package/dist/utils/atomicJson.js.map +7 -1
- package/dist/utils/filesystem.js +15 -18
- package/dist/utils/filesystem.js.map +7 -1
- package/dist/utils/lockfile.js +68 -71
- package/dist/utils/lockfile.js.map +7 -1
- package/dist/verification.d.ts +1 -19
- package/dist/verification.js +1020 -1929
- package/dist/verification.js.map +7 -1
- package/dist/verificationGate.test.js +127 -117
- package/dist/verificationGate.test.js.map +7 -1
- package/dist/version.d.ts +6 -0
- package/dist/version.js +24 -10
- package/dist/version.js.map +7 -1
- package/dist/worktree.d.ts +3 -15
- package/dist/worktree.js +97 -177
- package/dist/worktree.js.map +7 -1
- package/package.json +10 -8
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/README.md +47 -156
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +261 -43
- package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
- package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
- package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
- package/dist/investigationCompletion.test.js +0 -728
- package/dist/investigationCompletion.test.js.map +0 -1
- package/dist/setup.d.ts +0 -60
- package/dist/setup.js +0 -585
- package/dist/setup.js.map +0 -1
- package/dist/setup.test.js +0 -3058
- package/dist/setup.test.js.map +0 -1
- package/dist/worktreeTransition.d.ts +0 -211
- package/dist/worktreeTransition.js +0 -1037
- package/dist/worktreeTransition.js.map +0 -1
- package/dist/worktreeTransition.test.js +0 -1191
- package/dist/worktreeTransition.test.js.map +0 -1
- /package/dist/{investigationCompletion.test.d.ts → boardReconcile.test.d.ts} +0 -0
- /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
- /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"file":"issueJournal.test.js","sourceRoot":"","sources":["../src/issueJournal.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,EAAE,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,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7E,SAAS,EAAE,EAAE;iBACd;gBACD,uBAAuB;aACxB;SACO,EAAE,CAAC;YACX,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;YACtF,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAE,QAAQ,CAAC,OAA8B,CAAC,CAAC,CAAE,CAAC,IAAI,CAAsC,CAAC;YACjH,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAClC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,gDAAgD,CAAC,CAAC;QACtG,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,4CAA4C,CAAC,CAAC;IACnF,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/issueJournal.test.ts"],
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { z } from 'zod';\nimport { test, vi } from 'vitest';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';\nimport { createAiDeliveryMcpServer } from './mcp/index.js';\nimport { inertTarget } from './fixtures/inertTarget.js';\n\nimport { getAiDeliveryMcpTool } from './mcp/tools.js';\nimport * as issue from './issue.js';\nimport type { DeliveryContext } from './issue.js';\nimport type { JournalInput } from './issueJournal.js';\nimport * as journalReaders from './issueJournal.js';\nimport { JournalInputSchema, renderJournal, acceptanceCriteria, issueFollowUps } from './issueJournal.js';\nimport { executeTool } from './dispatch.js';\nimport * as configuration from './config/deliveryConfig.js';\nimport * as githubClients from './github/client.js';\nimport { execFileSync } from 'node:child_process';\nimport { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\n\ntest('latest rendered progress attention is unambiguous', () => {\n const parse = Reflect.get(journalReaders, 'parseJournalAttention') as\n | ((body: string) => { state: string; request: string | null })\n | undefined;\n assert.equal(typeof parse, 'function', 'rendered journal attention reader is available');\n const progress = (decisionNeeded: string, extra = {}) =>\n renderJournal({\n issueNumber: 17,\n kind: 'progress',\n summary: 'Current work.',\n status: 'In Progress',\n done: ['Prepared the design'],\n decisionNeeded,\n nextStep: 'Implement',\n nextDate: null,\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/issues/17'],\n ...extra,\n });\n for (const sentinel of ['None', 'None.', 'N/A', 'Not needed', ' nOnE. '])\n assert.equal(parse!(progress(sentinel)).state, 'clear');\n for (const request of [\n 'Approve design',\n 'Approve design\\nThen select an approach',\n '- Approve design\\n- Select approach',\n ])\n assert.deepEqual(parse!(progress(request)), { kind: 'progress', state: 'pending', request, reason: null });\n assert.equal(parse!(progress('Approve design', { done: ['x'.repeat(600)], lengthCap: 600 })).state, 'pending');\n const marker = `<!-- ai-delivery:journal@1:sha256:${'a'.repeat(64)} -->`;\n const prose = `${progress('Approve ai-delivery:journal@1 documentation')}\\n\\n${marker}`;\n assert.equal(parse!(prose).state, 'pending');\n assert.equal(parse!(`${prose}\\n\\n${marker}`).state, 'unknown');\n assert.equal(\n parse!(\n renderJournal({\n issueNumber: 17,\n kind: 'decision',\n summary: 'Approved.',\n status: 'Ready',\n decision: 'Use the design',\n rationale: 'Reviewed',\n nextStep: 'Implement',\n nextDate: null,\n keyNumbers: [],\n evidence: [],\n }),\n ).state,\n 'clear',\n );\n});\n\ntest('duplicate free-text structural labels are unknown', () => {\n const parse = Reflect.get(journalReaders, 'parseJournalAttention') as\n | ((body: string) => { state: string })\n | undefined;\n assert.equal(typeof parse, 'function');\n const input: JournalInput = {\n issueNumber: 17,\n kind: 'progress',\n summary: 'Current work.',\n status: 'Ready',\n done: ['Prepared'],\n decisionNeeded: 'Approve design',\n nextStep: 'Implement',\n nextDate: null,\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/issues/17'],\n };\n for (const details of [\n '**Decision needed:** None',\n '> **Decision needed:** None',\n '```md\\n**Decision needed:** None\\n```',\n '**Kind:** decision. **Status:** Ready',\n '<details>\\n**Decision needed:** None\\n</details>',\n ])\n assert.equal(parse!(renderJournal({ ...input, details })).state, 'unknown', details);\n for (const summary of ['```md', '~~~']) assert.equal(parse!(renderJournal({ ...input, summary })).state, 'unknown');\n for (const status of ['<det**ails>', '<!**-- ai-delivery:journal@1'])\n assert.equal(parse!(renderJournal({ ...input, status })).state, 'pending');\n assert.equal(parse!(renderJournal({ ...input, status: '\uD83D\uDE42'.repeat(16), nextStep: 'a. Next: b' })).state, 'pending');\n const marked = renderJournal(\n { ...input, decisionNeeded: 'None' },\n `<!-- ai-delivery:journal@1:sha256:${'a'.repeat(64)} -->`,\n );\n for (const header of [\n 'Status: <!-- ai-delivery:journal@. Next: Review.',\n 'Status: **Decision needed:** None. Next: Review.',\n 'Status: Ready\\t. Next: Review.',\n `Status: ${'\uD83D\uDE42'.repeat(17)}. Next: Review.`,\n ])\n assert.equal(parse!(`${header}${marked.slice(marked.indexOf('\\n\\n'))}`).state, 'unknown');\n const legacy =\n 'Status: Ready. Next: Review.\\n\\n**Kind:** progress. **Status:** Ready\\n\\n**Done since last:**\\n- Prepared\\n\\n**Decision needed:** Approve design\\n\\n**Key numbers:** None reported.\\n\\n**Next:** Review (date not scheduled).\\n\\n**Evidence:** https://github.com/example/widget/issues/17';\n assert.equal(parse!(legacy).state, 'pending');\n for (const body of [\n '> **Kind:** progress. **Status:** Ready\\n\\n**Decision needed:** Approve',\n '```\\n**Kind:** progress. **Status:** Ready\\n\\n**Decision needed:** Approve\\n```',\n '**Kind:** progress. **Status:** Ready\\n\\n**Decision needed:**',\n ])\n assert.equal(parse!(body).state, 'unknown');\n});\n\ntest('decision journal list fields start below their label and preserve nested structure', () => {\n const result = renderJournal({\n issueNumber: 17,\n kind: 'decision',\n summary: 'A decision was made.',\n status: 'Ready',\n decision: '- First\\n - Nested\\n- Second',\n rationale: 'The existing owner is sufficient.',\n nextStep: 'Run checks',\n nextDate: null,\n keyNumbers: [],\n evidence: [],\n });\n assert.equal(\n result,\n 'Status: Ready. Next: Run checks.\\n\\nA decision was made.\\n\\n**Kind:** decision. **Status:** Ready\\n\\n**Decision:**\\n- First\\n - Nested\\n- Second\\n\\n**Rationale:** The existing owner is sufficient.\\n\\n**Key numbers:** None reported.\\n\\n**Next:** Run checks (date not scheduled).\\n\\n**Evidence:** None yet.',\n );\n});\n\ntest('published comment schema lists required fields for every journal kind', () => {\n const schema = z.toJSONSchema(getAiDeliveryMcpTool('issue_comment')!.inputSchema);\n assert.deepEqual(schema.anyOf, [\n { properties: { kind: { const: 'start' } }, required: ['outcome'] },\n { properties: { kind: { const: 'progress' } }, required: ['done', 'decisionNeeded'] },\n { properties: { kind: { const: 'decision' } }, required: ['decision', 'rationale'] },\n { properties: { kind: { const: 'blocker' } }, required: ['blocker', 'resolution'] },\n { properties: { kind: { const: 'closeout' } }, required: ['acceptance', 'followUps'] },\n ]);\n});\n\ntest('all typed journals validate and lead with plain status and next-step previews', () => {\n const tool = getAiDeliveryMcpTool('issue_comment');\n assert.ok(tool, 'issue_comment must be exposed');\n const common = {\n issueNumber: 17,\n summary: 'Parser work is underway.',\n status: 'In progress',\n nextStep: 'Run checks',\n nextDate: '2026-10-09',\n keyNumbers: ['3 checks'],\n evidence: ['https://github.com/example/widget/pull/23'],\n };\n const valid: JournalInput[] = [\n { ...common, kind: 'start', outcome: 'Deliver a safe parser' },\n { ...common, kind: 'progress', done: ['Added validation'], decisionNeeded: 'None' },\n { ...common, kind: 'decision', decision: 'Use the existing parser', rationale: 'Preserves the contract' },\n { ...common, kind: 'blocker', blocker: 'Review pending', resolution: 'Independent acceptance' },\n {\n ...common,\n kind: 'closeout',\n acceptance: [{ criterion: 'Reject malformed input', evidence: 'https://github.com/example/widget/pull/23' }],\n followUps: [],\n },\n ];\n for (const input of valid) {\n for (const repo of [undefined, 'example/widget']) {\n for (const nextDate of [null, '2026-10-09', '2028-02-29']) {\n const selected = { ...input, nextDate, ...(repo === undefined ? {} : { repo }) };\n const parsed: ReturnType<typeof tool.inputSchema.safeParse> = tool.inputSchema.safeParse(selected);\n assert.equal(parsed.success, true, JSON.stringify(selected));\n if (parsed.success) assert.deepEqual(parsed.data, selected);\n }\n }\n assert.equal(JournalInputSchema.safeParse(input).success, true);\n assert.equal(JournalInputSchema.safeParse({ ...input, repo: 'example/widget' }).success, false);\n for (const summary of [input.summary, 'S'.repeat(500)]) {\n const marker = `<!-- ai-delivery:journal@1:sha256:${'a'.repeat(64)} -->`;\n const body = renderJournal(\n {\n ...input,\n summary,\n status: '**In progress**',\n nextStep: 'Run\\nchecks',\n lengthCap: 600,\n details: 'D'.repeat(900),\n },\n marker,\n );\n assert.equal(body.startsWith(`Status: In progress. Next: Run checks.\\n\\n${summary}\\n\\n`), true);\n assert.match(body, /<details>/u);\n assert.ok(body.endsWith(marker));\n assert.deepEqual(journalReaders.parseJournalAttention(body), {\n kind: input.kind,\n state: 'clear',\n request: null,\n reason: null,\n });\n }\n }\n for (const input of [\n { ...common, kind: 'progress' },\n { ...common, kind: 'start', outcome: '' },\n { ...common, kind: 'closeout', acceptance: [], followUps: [] },\n {\n ...common,\n kind: 'decision',\n decision: 'Use parser',\n rationale: 'Works',\n evidence: ['/Users/operator/checks.log'],\n },\n { ...common, kind: 'start', outcome: 'Deliver', nextDate: 'tomorrow' },\n { ...common, kind: 'start', outcome: 'Deliver', done: ['Wrong variant'] },\n { ...common, kind: 'progress', done: ['Deliver'], decisionNeeded: 'None', rationale: 'Wrong variant' },\n { ...common, kind: 'decision', decision: 'Use parser', rationale: 'Works', blocker: 'Wrong variant' },\n { ...common, kind: 'blocker', blocker: 'Review', resolution: 'Accept', outcome: 'Wrong variant' },\n { ...valid[4], done: ['Wrong variant'] },\n { ...valid[0], unknown: true },\n { ...valid[0], kind: 'unsupported' },\n { ...valid[0], nextDate: '2026-02-30' },\n { ...valid[0], nextDate: 20261009 },\n { ...valid[0], keyNumbers: '3 checks' },\n { ...valid[0], issueNumber: '17' },\n { ...valid[4], acceptance: [{ criterion: 'Deliver', evidence: common.evidence[0], unknown: true }] },\n ])\n for (const repo of [undefined, 'example/widget'])\n assert.equal(tool.inputSchema.safeParse({ ...input, ...(repo === undefined ? {} : { repo }) }).success, false);\n for (const repo of [\n '',\n 'example',\n 'example/widget/extra',\n 'https://github.com/example/widget',\n 'example/\\nwidget',\n 17,\n null,\n [],\n ])\n assert.equal(tool.inputSchema.safeParse({ ...valid[0], repo }).success, false);\n});\n\ntest('journal dispatch refuses invalid fields and repository conflicts before configuration or authentication', async () => {\n const settings = vi.spyOn(configuration, 'loadDeliverySettings').mockImplementation(async () => {\n throw new Error('Configuration must not load for an invalid journal');\n });\n const clients = vi.spyOn(githubClients, 'createDeliveryGitHubClients');\n const valid = {\n repo: 'example/widget',\n issueNumber: 17,\n kind: 'progress',\n summary: 'Parser work is underway.',\n status: 'In progress',\n done: ['Added validation'],\n decisionNeeded: 'None',\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/pull/23'],\n nextStep: 'Run checks',\n nextDate: null,\n };\n try {\n for (const input of [\n { ...valid, kind: 'unsupported' },\n { ...valid, outcome: 'Wrong variant' },\n { ...valid, unknown: true },\n { ...valid, done: [] },\n { ...valid, evidence: [] },\n { ...valid, repo: 'invalid' },\n { ...valid, repo: 17 },\n { ...valid, nextDate: '2026-02-30' },\n ])\n await assert.rejects(executeTool('issue_comment', input, { repoRoot: '/non-git-fixture' }));\n await assert.rejects(\n executeTool('issue_comment', valid, { repoRoot: '/non-git-fixture', repo: 'example/other' }),\n /selectors disagree/u,\n );\n assert.equal(settings.mock.calls.length, 0);\n assert.equal(clients.mock.calls.length, 0, 'no authenticated client or comment writer is reached');\n } finally {\n settings.mockRestore();\n clients.mockRestore();\n }\n});\n\ntest('canonical comment writes read back and recover a lost response without duplicates', async () => {\n const comment = (\n issue as unknown as {\n commentIssue?: (\n context: DeliveryContext,\n input: JournalInput | { issueNumber: number; body: string },\n lifecycleKey?: string,\n ) => Promise<{ commentId: number; url: string; body: string; reused: boolean }>;\n }\n ).commentIssue;\n assert.ok(comment, 'canonical comment writer must exist');\n const agent = await import('./agent.js');\n assert.equal(agent.commentIssue, comment);\n assert.equal(agent.ISSUE_COMMENT_BODY_LIMIT, 65536);\n const root = mkdtempSync(join(tmpdir(), 'ai-delivery-journal-'));\n execFileSync('git', ['init', '-q', '-b', 'main'], { cwd: root });\n const stored: { id: number; body: string; html_url: string; user: { login: string }; issue_url: string }[] = [];\n let loseResponse = true;\n let corruptReadback = false;\n let authorCalls = 0;\n const context = {\n root,\n repo: { owner: 'example', repo: 'widget' },\n clients: {\n role: 'author',\n authenticatedAuthor: async () => {\n authorCalls += 1;\n return { actorLogin: 'operator', credentialIdentity: 'user:1' };\n },\n rest: {\n issues: {\n get: async () => ({ data: { number: 17, state: 'open' } }),\n listComments: async () => ({ data: stored }),\n createComment: async (input: { body: string }) => {\n const id = 91 + stored.length;\n const data = {\n id,\n body: input.body,\n html_url: `https://github.com/example/widget/issues/17#issuecomment-${String(id)}`,\n issue_url: 'https://api.github.com/repos/example/widget/issues/17',\n user: { login: 'operator' },\n };\n stored.push(data);\n if (loseResponse) {\n loseResponse = false;\n throw new Error('response lost');\n }\n return { data };\n },\n getComment: async (input: { comment_id: number }) => ({\n data: {\n ...stored.find((item) => item.id === input.comment_id),\n ...(corruptReadback ? { body: 'changed' } : {}),\n },\n }),\n },\n },\n },\n } as unknown as DeliveryContext;\n const input: JournalInput = {\n issueNumber: 17,\n kind: 'start',\n summary: 'Implementation started.',\n status: 'In progress',\n outcome: 'Deliver validation',\n keyNumbers: [],\n evidence: [],\n nextStep: 'Run checks',\n nextDate: '2026-10-09',\n };\n try {\n await assert.rejects(comment(context, input), /response lost/u);\n const recovered = await comment(context, input);\n assert.equal(recovered.commentId, 91);\n assert.equal(recovered.reused, true);\n assert.equal(stored.length, 1);\n assert.match(recovered.body, /^Status: In progress\\. Next: Run checks\\.\\n\\nImplementation started\\./u);\n corruptReadback = true;\n await assert.rejects(comment(context, input), /readback/u);\n corruptReadback = false;\n\n stored.push({ ...stored[0]!, id: 99, html_url: 'https://github.com/example/widget/issues/17#issuecomment-99' });\n await assert.rejects(comment(context, input), /duplicate authored retry matches/u);\n assert.equal(stored.length, 2, 'ambiguous retries must not write another comment');\n stored.pop();\n\n const rawBody = `\\r\\n <details>\\n<summary>Prior content</summary>\\n<pre>${'\uD83D\uDE42 & prior title/body\\r\\n'.repeat(600)}</pre>\\n</details> \\t\\n`;\n assert.ok(rawBody.length > 10000);\n loseResponse = true;\n await assert.rejects(comment(context, { issueNumber: 17, body: rawBody }), /response lost/u);\n const rawRecovered = await comment(context, { issueNumber: 17, body: rawBody });\n assert.equal(rawRecovered.body, rawBody, 'raw history content must remain exact and unwrapped');\n assert.equal(rawRecovered.commentId, 92);\n assert.equal(rawRecovered.reused, true);\n assert.equal(stored.length, 2);\n assert.equal(stored[1]!.body, rawBody, 'no journal marker or unrequested content is appended');\n\n const maximumBody = '\uD83D\uDE42'.repeat(32768);\n assert.equal(maximumBody.length, 65536);\n assert.equal((await comment(context, { issueNumber: 17, body: maximumBody })).body, maximumBody);\n assert.equal(stored.length, 3);\n const beforeInvalid = authorCalls;\n for (const body of ['', ' \\r\\n\\t ', 'x'.repeat(65537), `${maximumBody}\uD83D\uDE42`])\n await assert.rejects(comment(context, { issueNumber: 17, body }), /comment body/u);\n await assert.rejects(\n comment(context, {\n ...input,\n status: 'x'.repeat(9000),\n outcome: 'x'.repeat(9000),\n nextStep: 'x'.repeat(9000),\n details: 'x'.repeat(9000),\n keyNumbers: Array.from({ length: 4 }, () => 'x'.repeat(9000)),\n }),\n /comment body/u,\n );\n await assert.rejects(\n comment(context, { issueNumber: 17, body: rawBody }, 'start:legacy'),\n /lifecycle journal key/u,\n );\n assert.equal(authorCalls, beforeInvalid, 'unsupported payloads fail before authentication or mutation');\n assert.equal(stored.length, 3);\n corruptReadback = true;\n await assert.rejects(comment(context, { issueNumber: 17, body: rawBody }), /readback/u);\n } finally {\n rmSync(root, { recursive: true, force: true });\n }\n});\n\ntest('length cap keeps the summary visible and moves every excess field into collapsed detail', () => {\n const summary = 'S'.repeat(500);\n const rendered = renderJournal({\n issueNumber: 17,\n kind: 'progress',\n summary,\n status: 'In progress '.repeat(500),\n done: ['A'.repeat(900)],\n decisionNeeded: 'None',\n keyNumbers: ['7 tests'],\n evidence: ['https://github.com/example/widget/pull/23'],\n nextStep: 'Review '.repeat(1000),\n nextDate: '2026-10-09',\n lengthCap: 600,\n });\n const first = rendered.split('\\n')[0]!;\n assert.ok(first.startsWith('Status: In progress'));\n assert.ok(first.length <= 100 && rendered.split('\\n')[2] === summary);\n assert.ok(rendered.indexOf('Next: Review') < rendered.indexOf(summary));\n assert.match(rendered, /<details>/u);\n assert.match(rendered, /A{900}/u);\n assert.match(rendered, /7 tests/u);\n assert.match(rendered, /https:\\/\\/github.com\\/example\\/widget\\/pull\\/23/u);\n});\n\ntest('automatic closeout selects acceptance checkboxes and declared follow-ups without swallowing other sections', () => {\n const body =\n '## Outcome\\nShip.\\n\\n## Acceptance Criteria\\n- [ ] Validation works\\n- [x] Recovery works\\n\\n## Follow-ups\\n- Track post-release adoption: https://github.com/example/widget/issues/24\\n\\n## Non-goals\\n- [ ] Not an acceptance criterion';\n assert.deepEqual(acceptanceCriteria(body), ['Validation works', 'Recovery works']);\n assert.deepEqual(issueFollowUps(body), ['Track post-release adoption: https://github.com/example/widget/issues/24']);\n});\n\ntest('closeout accepts every readiness heading level and stops at the next heading', () => {\n for (let level = 1; level <= 6; level += 1) {\n for (let indent = 0; indent <= 3; indent += 1) {\n const heading = `${' '.repeat(indent)}${'#'.repeat(level)}`;\n const body = `${heading}\\tAcceptance Criteria\\n-[ ] Compact bullet\\n*\\t[X]\\tTabbed bullet\\n+ [x] Checked bullet\\n###### Other section\\n- [ ] Excluded\\n${heading} Follow-ups\\n- [ ] Deferred work\\n# Other section\\n- Excluded`;\n assert.deepEqual(acceptanceCriteria(body), ['Compact bullet', 'Tabbed bullet', 'Checked bullet']);\n assert.deepEqual(issueFollowUps(body), ['Deferred work']);\n }\n }\n});\n\ntest('journal evidence rejects local hosts and IP literals while accepting public DNS names', () => {\n const tool = getAiDeliveryMcpTool('issue_comment')!;\n const input = {\n issueNumber: 17,\n kind: 'start',\n summary: 'Work started.',\n status: 'Started',\n outcome: 'Deliver validation',\n keyNumbers: [],\n nextStep: 'Run checks',\n nextDate: null,\n };\n for (const host of [\n 'localhost',\n 'localhost.',\n 'api.localhost',\n 'runner.local',\n '127.0.0.1',\n '10.1.2.3',\n '172.16.0.1',\n '192.168.1.1',\n '169.254.1.1',\n '[::1]',\n '[fd00::1]',\n '[fe80::1]',\n '8.8.8.8',\n ])\n assert.equal(tool.inputSchema.safeParse({ ...input, evidence: [`https://${host}/evidence`] }).success, false, host);\n for (const host of ['github.com', '10.docs.example.com'])\n assert.equal(tool.inputSchema.safeParse({ ...input, evidence: [`https://${host}/evidence`] }).success, true, host);\n});\n\ntest('registered journal tool returns actionable decision refusals before native writes', async ({ signal }) => {\n const f = inertTarget(signal);\n const server = createAiDeliveryMcpServer({ repoRoot: f.root, signal });\n const client = new Client({ name: 'journal-contract-fixture', version: '1' });\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const common = {\n repo: 'example/widget',\n issueNumber: 17,\n summary: 'Parser validation is ready.',\n status: 'In progress',\n nextStep: 'Review the parser',\n nextDate: null,\n keyNumbers: [],\n evidence: ['https://github.com/example/widget/pull/23'],\n };\n const decision = {\n ...common,\n kind: 'decision',\n decision: 'Use the existing parser',\n rationale: 'Preserves compatibility',\n };\n try {\n await server.connect(serverTransport);\n await client.connect(clientTransport);\n // A successful call first proves the synthetic external ports and real dispatch are wired correctly.\n const valid = await client.callTool({ name: 'issue_comment', arguments: decision });\n assert.notEqual(valid.isError, true, JSON.stringify(valid));\n assert.equal(f.comments.length, 1);\n const before = f.calls.length;\n const { rationale: _rationale, ...missingRationale } = decision;\n const refused = await client.callTool({ name: 'issue_comment', arguments: missingRationale });\n assert.equal(refused.isError, true);\n assert.equal(f.comments.length, 1, 'the invalid call makes zero additional native writes');\n assert.equal(f.calls.length, before, 'refusal precedes external authentication and reads');\n const text = JSON.stringify(refused);\n assert.doesNotMatch(text, /-32602|Input validation error/u, 'a normal contract refusal must reach the handler');\n assert.match(text, /rationale/u);\n const missingBoth = await client.callTool({ name: 'issue_comment', arguments: { ...common, kind: 'progress' } });\n assert.equal(missingBoth.isError, true);\n assert.match(JSON.stringify(missingBoth), /Missing required fields: done, decisionNeeded/u);\n const missingCommon = await client.callTool({\n name: 'issue_comment',\n arguments: { repo: 'example/widget', issueNumber: 17, kind: 'decision' },\n });\n assert.equal(missingCommon.isError, true);\n assert.match(\n JSON.stringify(missingCommon),\n /Missing required fields: summary, status, nextStep, nextDate, keyNumbers, evidence, decision, rationale/u,\n );\n assert.doesNotMatch(JSON.stringify(missingCommon), /-32602|Input validation error/u);\n\n const published = (await client.listTools()).tools.find((t) => t.name === 'issue_comment');\n assert.deepEqual(\n published?.inputSchema.anyOf,\n z.toJSONSchema(getAiDeliveryMcpTool('issue_comment')!.inputSchema).anyOf,\n );\n assert.match(text, /[Pp]rovide/u, 'the refusal explains the correction');\n const listed = (await client.listTools()).tools.find((tool) => tool.name === 'issue_comment');\n assert.ok(listed);\n assert.match(listed.description ?? '', /decision: non-empty decision and rationale/u);\n const properties = listed.inputSchema.properties as Record<string, { description?: string }>;\n for (const field of ['decision', 'rationale'])\n assert.match(properties[field]?.description ?? '', /Required non-empty text when kind is decision/u);\n assert.match(properties.kind?.description ?? '', /progress: done, decisionNeeded and non-empty evidence/u);\n assert.equal(listed.inputSchema.additionalProperties, false);\n\n const { decision: _decision, ...missingDecision } = decision;\n for (const invalid of [\n missingDecision,\n { ...missingRationale, decision: 'PRIVATE_INPUT_SENTINEL' },\n { ...decision, rationale: '' },\n { ...decision, rationale: 17 },\n { ...decision, kind: 'PRIVATE_INPUT_SENTINEL' },\n { ...decision, unknown: 'PRIVATE_INPUT_SENTINEL' },\n { ...decision, PRIVATE_INPUT_SENTINEL: 'private value' },\n {\n ...common,\n kind: 'closeout',\n acceptance: [{ criterion: 'Validated', evidence: common.evidence[0], PRIVATE_INPUT_SENTINEL: 'private value' }],\n followUps: [],\n },\n { ...decision, outcome: 'PRIVATE_INPUT_SENTINEL' },\n { ...common, kind: 'start' },\n { ...common, kind: 'progress', done: ['Validated'], decisionNeeded: 'None', evidence: [] },\n { ...common, kind: 'blocker', blocker: 'Review pending' },\n { ...common, kind: 'closeout', acceptance: [], followUps: [] },\n ]) {\n const invalidResult = await client.callTool({ name: 'issue_comment', arguments: invalid });\n assert.equal(invalidResult.isError, true);\n assert.doesNotMatch(JSON.stringify(invalidResult), /PRIVATE_INPUT_SENTINEL/u);\n assert.equal(f.comments.length, 1, 'invalid journals never create a native comment');\n assert.equal(f.calls.length, before, 'invalid journals stop before external ports');\n }\n\n const renderedDecision = f.comments[0]!.body;\n assert.match(\n renderedDecision,\n /^Status: In progress\\. Next: Review the parser\\.\\n\\nParser validation is ready\\.\\n\\n\\*\\*Kind:\\*\\* decision\\. \\*\\*Status:\\*\\* In progress\\n\\n\\*\\*Decision:\\*\\* Use the existing parser\\n\\n\\*\\*Rationale:\\*\\* Preserves compatibility/u,\n );\n assert.match(renderedDecision, /<!-- ai-delivery:journal@1:sha256:[a-f0-9]{64} -->$/u);\n const retry = await client.callTool({ name: 'issue_comment', arguments: { ...decision, verbose: true } });\n assert.notEqual(retry.isError, true);\n const retried = JSON.parse((retry.content as { text: string }[])[0]!.text) as {\n body: string;\n reused: boolean;\n commentId: number;\n url: string;\n };\n assert.equal(retried.reused, true);\n assert.equal(retried.body, renderedDecision);\n assert.equal(retried.commentId, 101);\n assert.equal(retried.url, 'https://github.com/example/widget/issues/17#issuecomment-101');\n assert.equal(f.comments.length, 1);\n for (const [variant, section] of [\n [{ ...common, kind: 'start', outcome: 'Deliver validation' }, '**Outcome:** Deliver validation'],\n [\n { ...common, kind: 'progress', done: ['Validated'], decisionNeeded: 'None' },\n '**Done since last:**\\n- Validated',\n ],\n [\n { ...common, kind: 'blocker', blocker: 'Review pending', resolution: 'Independent acceptance' },\n '**Resolution needed:** Independent acceptance',\n ],\n [\n {\n ...common,\n kind: 'closeout',\n acceptance: [{ criterion: 'Validation works', evidence: common.evidence[0] }],\n followUps: [],\n },\n '**Follow-ups:** None.',\n ],\n ] as const) {\n const accepted = await client.callTool({ name: 'issue_comment', arguments: { ...variant, verbose: true } });\n assert.notEqual(accepted.isError, true, JSON.stringify(accepted));\n const value = JSON.parse((accepted.content as { text: string }[])[0]!.text) as { body: string; reused: boolean };\n assert.equal(value.reused, false);\n assert.ok(value.body.includes(section));\n assert.equal(value.body, f.comments.at(-1)!.body, 'response retains authoritative native readback');\n }\n assert.equal(f.comments.length, 5, 'all five valid journal kinds remain usable');\n } finally {\n await client.close();\n await server.close();\n await f.dispose(undefined);\n }\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,SAAS;AAClB,SAAS,MAAM,UAAU;AACzB,SAAS,cAAc;AACvB,SA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F,CAAC;",
|
|
6
|
+
"names": ["input"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
3
|
+
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
4
|
+
import { afterEach, test, vi } from "vitest";
|
|
5
|
+
import * as settings from "./config/deliveryConfig.js";
|
|
6
|
+
import * as issues from "./issue.js";
|
|
7
|
+
import { createAiDeliveryMcpServer } from "./mcp/index.js";
|
|
8
|
+
import { issueInfo, listIssueSubissues } from "./issue.js";
|
|
9
|
+
import { issue63Fixture } from "./fixtures/issue63.js";
|
|
10
|
+
import { CollectionLimitError } from "./errors.js";
|
|
11
|
+
function rollupFixture() {
|
|
12
|
+
const f = issue63Fixture();
|
|
13
|
+
const children = [18, 19, 20].map((number) => ({
|
|
14
|
+
...f.rows.get(18),
|
|
15
|
+
id: 100 + number,
|
|
16
|
+
node_id: `ISSUE${number}`,
|
|
17
|
+
number,
|
|
18
|
+
state: number === 18 ? "closed" : "open",
|
|
19
|
+
html_url: `https://github.com/example/widget/issues/${number}`,
|
|
20
|
+
url: `https://api.github.com/repos/example/widget/issues/${number}`,
|
|
21
|
+
repository_url: "https://api.github.com/repos/example/widget"
|
|
22
|
+
}));
|
|
23
|
+
for (const child of children) f.rows.set(child.number, child);
|
|
24
|
+
f.statuses.set(18, "Active");
|
|
25
|
+
f.statuses.set(19, "Queued");
|
|
26
|
+
f.statuses.set(20, "Active");
|
|
27
|
+
const points = /* @__PURE__ */ new Map([
|
|
28
|
+
[17, "2"],
|
|
29
|
+
[18, "4"],
|
|
30
|
+
[19, "1"],
|
|
31
|
+
[20, "2"]
|
|
32
|
+
]);
|
|
33
|
+
const dates = /* @__PURE__ */ new Map([
|
|
34
|
+
[18, "1900-01-01"],
|
|
35
|
+
[19, "2020-02-29"],
|
|
36
|
+
[20, null]
|
|
37
|
+
]);
|
|
38
|
+
const controls = {
|
|
39
|
+
pages: [children],
|
|
40
|
+
links: /* @__PURE__ */ new Map(),
|
|
41
|
+
failedPage: 0,
|
|
42
|
+
dateMode: "configured",
|
|
43
|
+
projectIdentity: "PROJECT",
|
|
44
|
+
missingProjectIssue: void 0,
|
|
45
|
+
archivedChildren: /* @__PURE__ */ new Set(),
|
|
46
|
+
failChildProjectRead: false
|
|
47
|
+
};
|
|
48
|
+
const childPages = [];
|
|
49
|
+
const metadataReads = [];
|
|
50
|
+
const refuseWrite = async () => {
|
|
51
|
+
throw new Error("Unexpected rollup native issue mutation");
|
|
52
|
+
};
|
|
53
|
+
f.context.clients.rest.issues.create = refuseWrite;
|
|
54
|
+
f.context.clients.rest.issues.update = refuseWrite;
|
|
55
|
+
f.context.clients.rest.issues.createComment = refuseWrite;
|
|
56
|
+
f.context.clients.rest.issues.listSubIssues = (async (input) => {
|
|
57
|
+
assert.equal(input.owner, "example");
|
|
58
|
+
assert.equal(input.repo, "widget");
|
|
59
|
+
assert.equal(input.issue_number, 17, "Rollup must not recurse into a child");
|
|
60
|
+
const page = Number(input.page ?? 1);
|
|
61
|
+
childPages.push(page);
|
|
62
|
+
if (page === controls.failedPage)
|
|
63
|
+
throw Object.assign(new Error("Synthetic child page unavailable"), { status: 409 });
|
|
64
|
+
return { data: controls.pages[page - 1] ?? [], headers: { link: controls.links.get(page) } };
|
|
65
|
+
});
|
|
66
|
+
f.context.clients.rest.request = (async (route, input) => {
|
|
67
|
+
if (route === "GET /orgs/{org}/issue-fields")
|
|
68
|
+
return {
|
|
69
|
+
data: [
|
|
70
|
+
{ id: 101, name: "Estimate", data_type: "single_select" },
|
|
71
|
+
{ id: 102, name: "Urgency", data_type: "single_select" },
|
|
72
|
+
...controls.dateMode === "missing" ? [] : [{ id: 104, name: "Target date", data_type: controls.dateMode === "wrong" ? "text" : "date" }]
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
if (route === "GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values") {
|
|
76
|
+
assert.equal(input.owner, "example");
|
|
77
|
+
assert.equal(input.repo, "widget");
|
|
78
|
+
const number = Number(input.issue_number);
|
|
79
|
+
metadataReads.push(number);
|
|
80
|
+
return {
|
|
81
|
+
data: [
|
|
82
|
+
...points.has(number) ? [
|
|
83
|
+
{
|
|
84
|
+
issue_field_id: 101,
|
|
85
|
+
issue_field_name: "Estimate",
|
|
86
|
+
data_type: "single_select",
|
|
87
|
+
value: points.get(number)
|
|
88
|
+
}
|
|
89
|
+
] : [],
|
|
90
|
+
...controls.dateMode === "missing" || !dates.has(number) ? [] : [
|
|
91
|
+
{
|
|
92
|
+
issue_field_id: 104,
|
|
93
|
+
issue_field_name: "Target date",
|
|
94
|
+
data_type: controls.dateMode === "wrong" ? "text" : "date",
|
|
95
|
+
value: dates.get(number)
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Unexpected rollup REST operation ${route}`);
|
|
102
|
+
});
|
|
103
|
+
const graphql = f.context.clients.graphql;
|
|
104
|
+
f.context.clients.graphql = (async (query, variables) => {
|
|
105
|
+
assert.ok(!/\bmutation\b/u.test(query), "Rollup must never write Project or issue state");
|
|
106
|
+
if (controls.failChildProjectRead && query.includes("ProjectDeliveryIssueItems") && metadataReads.some((number) => number !== 17))
|
|
107
|
+
throw new Error("Synthetic child Project read unavailable");
|
|
108
|
+
f.controls.missingProjectIssue = controls.missingProjectIssue;
|
|
109
|
+
const result = await graphql(query, variables);
|
|
110
|
+
if (query.includes("blockedBy(first:"))
|
|
111
|
+
Object.assign(result.repository.issue, {
|
|
112
|
+
id: `ISSUE${String(variables.number)}`,
|
|
113
|
+
number: variables.number,
|
|
114
|
+
repository: { nameWithOwner: "example/widget" }
|
|
115
|
+
});
|
|
116
|
+
if (query.includes("ProjectDeliveryIssueItems")) {
|
|
117
|
+
const items = result.node.projectItems.nodes;
|
|
118
|
+
for (const item of items) {
|
|
119
|
+
item.project.id = controls.projectIdentity;
|
|
120
|
+
if (controls.archivedChildren.has(Number(item.content.id.replace("ISSUE", "")))) item.isArchived = true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
});
|
|
125
|
+
const read = async () => await issueInfo(f.context, 17);
|
|
126
|
+
return { ...f, nativeControls: f.controls, children, points, dates, controls, childPages, metadataReads, read };
|
|
127
|
+
}
|
|
128
|
+
test("parent readback counts direct children and preserves live status and overdue open dates", async () => {
|
|
129
|
+
const f = rollupFixture();
|
|
130
|
+
assert.deepEqual((await f.read()).childProgress, {
|
|
131
|
+
childCount: 3,
|
|
132
|
+
closedChildCount: 1,
|
|
133
|
+
percentClosed: 33.3,
|
|
134
|
+
pointsTotal: 7,
|
|
135
|
+
inProgressChildren: [18, 20],
|
|
136
|
+
nextTargetDate: "2020-02-29",
|
|
137
|
+
missingPoints: [],
|
|
138
|
+
missingProjectStatus: [],
|
|
139
|
+
undatedOpenChildren: [20],
|
|
140
|
+
targetDateConfigured: true
|
|
141
|
+
});
|
|
142
|
+
assert.deepEqual(f.childPages, [1]);
|
|
143
|
+
assert.deepEqual(f.writes, []);
|
|
144
|
+
});
|
|
145
|
+
test("a successful zero-child read preserves leaf shape", async () => {
|
|
146
|
+
const f = rollupFixture();
|
|
147
|
+
f.controls.pages = [[]];
|
|
148
|
+
const info = await f.read();
|
|
149
|
+
assert.equal(Object.hasOwn(info, "childProgress"), false);
|
|
150
|
+
assert.equal(info.title, f.rows.get(17).title);
|
|
151
|
+
assert.deepEqual(f.writes, []);
|
|
152
|
+
});
|
|
153
|
+
test("short child pages with next links contribute to one complete direct rollup", async () => {
|
|
154
|
+
const f = rollupFixture();
|
|
155
|
+
f.controls.pages = [[f.children[1]], [f.children[0], f.children[2]]];
|
|
156
|
+
f.controls.links.set(
|
|
157
|
+
1,
|
|
158
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next"'
|
|
159
|
+
);
|
|
160
|
+
const progress = (await f.read()).childProgress;
|
|
161
|
+
assert.ok(progress, "Parent progress is missing from readback");
|
|
162
|
+
assert.equal(progress.childCount, 3);
|
|
163
|
+
assert.equal(progress.pointsTotal, 7);
|
|
164
|
+
assert.deepEqual(f.childPages, [1, 2]);
|
|
165
|
+
});
|
|
166
|
+
test("a bounded caller refuses child pagination before requesting a page outside its scope", async () => {
|
|
167
|
+
const f = rollupFixture();
|
|
168
|
+
f.context.readPageLimit = 1;
|
|
169
|
+
f.controls.pages = [[f.children[0]], [f.children[1], f.children[2]]];
|
|
170
|
+
f.controls.links.set(
|
|
171
|
+
1,
|
|
172
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next"'
|
|
173
|
+
);
|
|
174
|
+
await assert.rejects(
|
|
175
|
+
() => listIssueSubissues(f.context, 17),
|
|
176
|
+
(error) => {
|
|
177
|
+
assert.ok(error instanceof CollectionLimitError);
|
|
178
|
+
assert.equal(error.collection, "native-sub-issues");
|
|
179
|
+
assert.equal(error.pagesRequested, 1);
|
|
180
|
+
assert.equal(error.rowsObserved, 1);
|
|
181
|
+
assert.equal(error.limit, 1);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
assert.deepEqual(f.childPages, [1]);
|
|
186
|
+
assert.deepEqual(f.metadataReads, []);
|
|
187
|
+
assert.deepEqual(f.writes, []);
|
|
188
|
+
});
|
|
189
|
+
test("bounded parent progress preserves the Project definition page budget", async () => {
|
|
190
|
+
const f = rollupFixture();
|
|
191
|
+
f.context.readPageLimit = 1;
|
|
192
|
+
const graphql = f.context.clients.graphql;
|
|
193
|
+
let definitionRequests = 0;
|
|
194
|
+
f.context.clients.graphql = (async (query, variables) => {
|
|
195
|
+
if (query.includes("ProjectDeliveryConfiguration")) {
|
|
196
|
+
definitionRequests++;
|
|
197
|
+
return {
|
|
198
|
+
organization: {
|
|
199
|
+
projectV2: {
|
|
200
|
+
id: "PROJECT",
|
|
201
|
+
number: 1,
|
|
202
|
+
title: "Delivery",
|
|
203
|
+
closed: false,
|
|
204
|
+
viewerCanUpdate: true,
|
|
205
|
+
fields: {
|
|
206
|
+
nodes: [],
|
|
207
|
+
pageInfo: { hasNextPage: definitionRequests === 1, endCursor: `page-${String(definitionRequests)}` }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const result = await graphql(query, variables);
|
|
214
|
+
if (query.includes("ProjectDeliveryIssueItems")) delete f.context.projectConfiguration;
|
|
215
|
+
return result;
|
|
216
|
+
});
|
|
217
|
+
await assert.rejects(f.read, (error) => {
|
|
218
|
+
assert.ok(error instanceof CollectionLimitError);
|
|
219
|
+
assert.equal(error.collection, "project-fields");
|
|
220
|
+
assert.equal(error.pagesRequested, 1);
|
|
221
|
+
assert.equal(error.rowsObserved, 0);
|
|
222
|
+
assert.equal(error.limit, 1);
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
assert.equal(definitionRequests, 1);
|
|
226
|
+
assert.deepEqual(f.metadataReads, [17]);
|
|
227
|
+
assert.deepEqual(f.writes, []);
|
|
228
|
+
});
|
|
229
|
+
for (const page of [1, 2])
|
|
230
|
+
test(`HTTP409 on child page ${page} refuses complete progress and numeric child listing`, async () => {
|
|
231
|
+
const f = rollupFixture();
|
|
232
|
+
f.controls.failedPage = page;
|
|
233
|
+
f.controls.links.set(
|
|
234
|
+
1,
|
|
235
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next"'
|
|
236
|
+
);
|
|
237
|
+
await assert.rejects(f.read, /child page unavailable/u);
|
|
238
|
+
await assert.rejects(() => listIssueSubissues(f.context, 17), /child page unavailable/u);
|
|
239
|
+
assert.deepEqual(f.writes, []);
|
|
240
|
+
});
|
|
241
|
+
test("explicitly unset Points and established missing status remain unavailable", async () => {
|
|
242
|
+
const f = rollupFixture();
|
|
243
|
+
f.points.set(19, null);
|
|
244
|
+
f.controls.dateMode = "missing";
|
|
245
|
+
f.controls.missingProjectIssue = 20;
|
|
246
|
+
const progress = (await f.read()).childProgress;
|
|
247
|
+
assert.ok(progress, "Parent progress is missing from readback");
|
|
248
|
+
assert.equal(progress.pointsTotal, null);
|
|
249
|
+
assert.deepEqual(progress.missingPoints, [19]);
|
|
250
|
+
assert.equal(progress.inProgressChildren, null);
|
|
251
|
+
assert.deepEqual(progress.missingProjectStatus, [20]);
|
|
252
|
+
assert.equal(progress.targetDateConfigured, false);
|
|
253
|
+
assert.equal(progress.nextTargetDate, null);
|
|
254
|
+
assert.deepEqual(progress.undatedOpenChildren, [19, 20]);
|
|
255
|
+
});
|
|
256
|
+
for (const mutation of ["foreign", "duplicate"])
|
|
257
|
+
test(`${mutation} child identity refuses before child metadata reads`, async () => {
|
|
258
|
+
const f = rollupFixture();
|
|
259
|
+
if (mutation === "foreign") f.children[0].repository_url = "https://api.github.com/repos/foreign/widget";
|
|
260
|
+
else f.controls.pages[0].push({ ...f.children[0] });
|
|
261
|
+
await assert.rejects(f.read, /child|repository|duplicate/iu);
|
|
262
|
+
assert.equal(
|
|
263
|
+
f.metadataReads.some((number) => number !== 17),
|
|
264
|
+
false
|
|
265
|
+
);
|
|
266
|
+
assert.deepEqual(f.writes, []);
|
|
267
|
+
});
|
|
268
|
+
test("individually valid Points cannot produce an unsafe aggregate", async () => {
|
|
269
|
+
const f = rollupFixture();
|
|
270
|
+
f.context.config.native.points = { ...f.context.config.native.points, values: ["1", "2", "4", "9007199254740991"] };
|
|
271
|
+
f.points.set(18, "9007199254740991");
|
|
272
|
+
await assert.rejects(f.read, /aggregate|safe integer|overflow/iu);
|
|
273
|
+
});
|
|
274
|
+
for (const identity of ["database", "node"])
|
|
275
|
+
test(`a child cannot reuse the parent's ${identity} identity under another number`, async () => {
|
|
276
|
+
const f = rollupFixture();
|
|
277
|
+
if (identity === "database") f.children[0].id = f.rows.get(17).id;
|
|
278
|
+
else f.children[0].node_id = f.rows.get(17).node_id;
|
|
279
|
+
await assert.rejects(f.read, /child|self|identity/iu);
|
|
280
|
+
assert.equal(
|
|
281
|
+
f.metadataReads.some((number) => number !== 17),
|
|
282
|
+
false
|
|
283
|
+
);
|
|
284
|
+
});
|
|
285
|
+
for (const link of [
|
|
286
|
+
'<https://api.github.com/repos/foreign/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next"',
|
|
287
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=1>; rel="next"',
|
|
288
|
+
"invalid pagination",
|
|
289
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=3>; rel="last"',
|
|
290
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next", <https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=1>; rel="last"',
|
|
291
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=1>; rel="last", <https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=1>; rel="last"',
|
|
292
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="prev"',
|
|
293
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next", <https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=9007199254740992>; rel="last"'
|
|
294
|
+
])
|
|
295
|
+
test(`child pagination refuses ${link}`, async () => {
|
|
296
|
+
const f = rollupFixture();
|
|
297
|
+
f.controls.links.set(1, link);
|
|
298
|
+
await assert.rejects(f.read, /pagination/iu);
|
|
299
|
+
assert.equal(
|
|
300
|
+
f.metadataReads.some((number) => number !== 17),
|
|
301
|
+
false
|
|
302
|
+
);
|
|
303
|
+
});
|
|
304
|
+
test("duplicate identities on a later child page refuse the whole aggregate", async () => {
|
|
305
|
+
const f = rollupFixture();
|
|
306
|
+
f.controls.pages = [[f.children[0]], [f.children[1], { ...f.children[0] }]];
|
|
307
|
+
f.controls.links.set(
|
|
308
|
+
1,
|
|
309
|
+
'<https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=2>; rel="next"'
|
|
310
|
+
);
|
|
311
|
+
await assert.rejects(f.read, /duplicate/iu);
|
|
312
|
+
assert.equal(
|
|
313
|
+
f.metadataReads.some((number) => number !== 17),
|
|
314
|
+
false
|
|
315
|
+
);
|
|
316
|
+
});
|
|
317
|
+
for (const value of [void 0, "not-a-number", " 2"])
|
|
318
|
+
test(`a present malformed Points payload ${String(value)} cannot become missing Points`, async () => {
|
|
319
|
+
const f = rollupFixture();
|
|
320
|
+
f.points.set(19, value);
|
|
321
|
+
await assert.rejects(f.read, /value|payload/iu);
|
|
322
|
+
});
|
|
323
|
+
for (const value of ["2026-02-29", "2028-02-30", "2028-02-29T00:00:00Z"])
|
|
324
|
+
test(`an invalid child calendar date ${value} refuses a next-date summary`, async () => {
|
|
325
|
+
const f = rollupFixture();
|
|
326
|
+
f.dates.set(19, value);
|
|
327
|
+
await assert.rejects(f.read, /date/iu);
|
|
328
|
+
});
|
|
329
|
+
test("a named Target date definition with the wrong type is not unconfigured", async () => {
|
|
330
|
+
const f = rollupFixture();
|
|
331
|
+
f.controls.dateMode = "wrong";
|
|
332
|
+
await assert.rejects(f.read, /Target date|incompatible/iu);
|
|
333
|
+
});
|
|
334
|
+
test("strict catalog reads follow a short next-linked page", async () => {
|
|
335
|
+
const f = rollupFixture();
|
|
336
|
+
const request = f.context.clients.rest.request;
|
|
337
|
+
const pages = [];
|
|
338
|
+
f.context.clients.rest.request = (async (route, input) => {
|
|
339
|
+
const result = await request(route, input);
|
|
340
|
+
if (route !== "GET /orgs/{org}/issue-fields") return result;
|
|
341
|
+
const page = Number(input.page);
|
|
342
|
+
pages.push(page);
|
|
343
|
+
const data = result.data;
|
|
344
|
+
return page === 1 ? {
|
|
345
|
+
data: data.slice(0, 1),
|
|
346
|
+
headers: { link: '<https://api.github.com/orgs/example/issue-fields?per_page=100&page=2>; rel="next"' }
|
|
347
|
+
} : { data: data.slice(1), headers: {} };
|
|
348
|
+
});
|
|
349
|
+
const progress = (await f.read()).childProgress;
|
|
350
|
+
assert.equal(progress.targetDateConfigured, true);
|
|
351
|
+
assert.equal(progress.nextTargetDate, "2020-02-29");
|
|
352
|
+
assert.deepEqual(pages, [1, 2]);
|
|
353
|
+
});
|
|
354
|
+
test("an unavailable later metadata page does not produce a partial Points total", async () => {
|
|
355
|
+
const f = rollupFixture();
|
|
356
|
+
const request = f.context.clients.rest.request;
|
|
357
|
+
f.context.clients.rest.request = (async (route, input) => {
|
|
358
|
+
if (route.includes("issue-field-values") && input.issue_number === 19) {
|
|
359
|
+
if (input.page === 2) throw Object.assign(new Error("Synthetic metadata page unavailable"), { status: 409 });
|
|
360
|
+
const first = await request(route, input);
|
|
361
|
+
return {
|
|
362
|
+
data: first.data.slice(0, 1),
|
|
363
|
+
headers: {
|
|
364
|
+
link: '<https://api.github.com/repos/example/widget/issues/19/issue-field-values?per_page=100&page=2>; rel="next"'
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
return request(route, input);
|
|
369
|
+
});
|
|
370
|
+
await assert.rejects(f.read, /metadata page unavailable/iu);
|
|
371
|
+
});
|
|
372
|
+
test("a full native child page continues before publishing the aggregate", async () => {
|
|
373
|
+
const f = rollupFixture();
|
|
374
|
+
const full = Array.from({ length: 100 }, (_, index) => ({
|
|
375
|
+
...f.children[1],
|
|
376
|
+
number: 1e3 + index,
|
|
377
|
+
id: 2e3 + index,
|
|
378
|
+
node_id: `ISSUE${1e3 + index}`,
|
|
379
|
+
html_url: `https://github.com/example/widget/issues/${1e3 + index}`,
|
|
380
|
+
url: `https://api.github.com/repos/example/widget/issues/${1e3 + index}`
|
|
381
|
+
}));
|
|
382
|
+
f.controls.pages = [full, [f.children[0]]];
|
|
383
|
+
const progress = (await f.read()).childProgress;
|
|
384
|
+
assert.equal(progress.childCount, 101);
|
|
385
|
+
assert.equal(progress.closedChildCount, 1);
|
|
386
|
+
assert.equal(progress.percentClosed, 1);
|
|
387
|
+
assert.deepEqual(f.childPages, [1, 2]);
|
|
388
|
+
assert.deepEqual(f.writes, []);
|
|
389
|
+
});
|
|
390
|
+
test("an empty probe after a full final page accepts consistent previous and last links", async () => {
|
|
391
|
+
const f = rollupFixture();
|
|
392
|
+
const full = Array.from({ length: 100 }, (_, index) => ({
|
|
393
|
+
...f.children[1],
|
|
394
|
+
number: 1e3 + index,
|
|
395
|
+
id: 2e3 + index,
|
|
396
|
+
node_id: `ISSUE${1e3 + index}`,
|
|
397
|
+
html_url: `https://github.com/example/widget/issues/${1e3 + index}`,
|
|
398
|
+
url: `https://api.github.com/repos/example/widget/issues/${1e3 + index}`
|
|
399
|
+
}));
|
|
400
|
+
f.controls.pages = [full, []];
|
|
401
|
+
const last = "https://api.github.com/repos/example/widget/issues/17/sub_issues?per_page=100&page=1";
|
|
402
|
+
f.controls.links.set(2, `<${last}>; rel="prev", <${last}>; rel="last"`);
|
|
403
|
+
assert.equal((await listIssueSubissues(f.context, 17)).length, 100);
|
|
404
|
+
assert.deepEqual(f.childPages, [1, 2]);
|
|
405
|
+
});
|
|
406
|
+
test("an archived child Project item is unavailable rather than In Progress", async () => {
|
|
407
|
+
const f = rollupFixture();
|
|
408
|
+
f.controls.archivedChildren.add(20);
|
|
409
|
+
const progress = (await f.read()).childProgress;
|
|
410
|
+
assert.equal(progress.inProgressChildren, null);
|
|
411
|
+
assert.deepEqual(progress.missingProjectStatus, [20]);
|
|
412
|
+
assert.equal(progress.pointsTotal, 7);
|
|
413
|
+
});
|
|
414
|
+
test("an exact-item fallback can establish a genuinely unset child status", async () => {
|
|
415
|
+
const f = rollupFixture();
|
|
416
|
+
f.nativeControls.missingProjectStatus = 20;
|
|
417
|
+
f.nativeControls.projectItemReadback = { fieldValueByName: null };
|
|
418
|
+
const progress = (await f.read()).childProgress;
|
|
419
|
+
assert.equal(progress.inProgressChildren, null);
|
|
420
|
+
assert.deepEqual(progress.missingProjectStatus, [20]);
|
|
421
|
+
assert.ok(
|
|
422
|
+
f.graphqlCalls.some(
|
|
423
|
+
(call) => call.query.includes("ProjectDeliveryItemReadback") && call.variables.itemId === "ITEM20"
|
|
424
|
+
)
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
test("a failed child Project read refuses progress rather than claiming missing status", async () => {
|
|
428
|
+
const f = rollupFixture();
|
|
429
|
+
f.controls.failChildProjectRead = true;
|
|
430
|
+
await assert.rejects(f.read, /child Project read unavailable/u);
|
|
431
|
+
assert.deepEqual(f.writes, []);
|
|
432
|
+
});
|
|
433
|
+
for (const surface of ["catalog", "values"])
|
|
434
|
+
test(`contradictory ${surface} pagination cannot publish a complete rollup`, async () => {
|
|
435
|
+
const f = rollupFixture();
|
|
436
|
+
const request = f.context.clients.rest.request;
|
|
437
|
+
f.context.clients.rest.request = (async (route, input) => {
|
|
438
|
+
const result = await request(route, input);
|
|
439
|
+
if (surface === "catalog" && route === "GET /orgs/{org}/issue-fields" || surface === "values" && route.includes("issue-field-values") && input.issue_number === 19) {
|
|
440
|
+
const path = surface === "catalog" ? "/orgs/example/issue-fields" : "/repos/example/widget/issues/19/issue-field-values";
|
|
441
|
+
return { ...result, headers: { link: `<https://api.github.com${path}?per_page=100&page=3>; rel="last"` } };
|
|
442
|
+
}
|
|
443
|
+
return result;
|
|
444
|
+
});
|
|
445
|
+
await assert.rejects(f.read, /pagination/iu);
|
|
446
|
+
});
|
|
447
|
+
afterEach(() => vi.restoreAllMocks());
|
|
448
|
+
test("issue_info over MCP reports child counts, and the full rollup only with verbose", async () => {
|
|
449
|
+
const f = rollupFixture();
|
|
450
|
+
vi.spyOn(settings, "loadDeliverySettings").mockResolvedValue({
|
|
451
|
+
...f.context.config,
|
|
452
|
+
roles: { author: { authSource: "personal", identity: "author" }, reviewer: { identity: "reviewer" } }
|
|
453
|
+
});
|
|
454
|
+
vi.spyOn(issues, "loadDeliveryContext").mockResolvedValue(f.context);
|
|
455
|
+
const server = createAiDeliveryMcpServer({ repoRoot: "/nonexistent-launch-directory" });
|
|
456
|
+
const client = new Client({ name: "rollup-fixture", version: "1" });
|
|
457
|
+
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
458
|
+
try {
|
|
459
|
+
await server.connect(serverTransport);
|
|
460
|
+
await client.connect(clientTransport);
|
|
461
|
+
const read = async (verbose) => {
|
|
462
|
+
const result = await client.callTool({
|
|
463
|
+
name: "issue_info",
|
|
464
|
+
arguments: { repo: "example/widget", issueNumber: 17, ...verbose === void 0 ? {} : { verbose } }
|
|
465
|
+
});
|
|
466
|
+
assert.equal(result.isError, void 0, JSON.stringify(result.content));
|
|
467
|
+
return JSON.parse(result.content[0].text);
|
|
468
|
+
};
|
|
469
|
+
assert.deepEqual((await read()).childProgress, { childCount: 3, closedChildCount: 1, percentClosed: 33.3 });
|
|
470
|
+
assert.equal((await read(true)).childProgress.pointsTotal, 7);
|
|
471
|
+
} finally {
|
|
472
|
+
await client.close();
|
|
473
|
+
await server.close();
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
//# sourceMappingURL=issueRollup.test.js.map
|