{
"meta": {
"agent": "planner",
"task_id": "557",
"title": "BJ-17: E2E tier 2d-bitbucket",
"created_at": "2026-04-23T17:15:00Z"
},
"inputs": [
{
"name": "issue",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/557",
"notes": "BJ-17 — Wave 5 of Atlassian integration EPIC #539"
},
{
"name": "prereq-BJ-10",
"type": "link",
"ref": "AgentSDE/agent-core#550",
"notes": "platform-switched Claude env (OPEN)"
},
{
"name": "prereq-BJ-11",
"type": "link",
"ref": "AgentSDE/agent-core#551",
"notes": "tenant config routing (OPEN)"
},
{
"name": "prereq-BJ-15",
"type": "link",
"ref": "AgentSDE/agent-core#555",
"notes": "webhook clients + fixtures in agent-core-e2e (OPEN)"
},
{
"name": "prereq-BJ-16",
"type": "link",
"ref": "AgentSDE/agent-core#556",
"notes": "Atlassian mock server in agent-core-e2e (OPEN)"
},
{
"name": "test-modules-doc",
"type": "file",
"ref": "agent-core-e2e/TEST_MODULES.md",
"notes": "module registration + agent-core path mapping"
},
{
"name": "jest-module-config",
"type": "file",
"ref": "agent-core-e2e/jest.module.config.js",
"notes": "resolves test/<MODULE>/**/*.e2e-spec.ts"
}
],
"outputs": [
{
"name": "plan",
"type": "spec",
"format": "md",
"content": "plan.md"
},
{
"name": "prd",
"type": "spec",
"format": "json",
"content": "prd.json"
}
],
"files": [
{
"path": "test/bitbucket/bitbucket.happy-path.e2e-spec.ts",
"action": "create",
"reason": "Full Bitbucket happy-path scenario: pullrequest:created → PR/merge on mock → pullrequest:fulfilled close-out"
},
{
"path": "package.json",
"action": "modify",
"reason": "Add test:module:bitbucket script alongside existing per-module scripts"
},
{
"path": "TEST_MODULES.md",
"action": "modify",
"reason": "Register bitbucket module and add src/webhook/bitbucket/** → bitbucket mapping for targeted CI"
}
],
"steps": [
{
"id": "S1",
"summary": "Scaffold the bitbucket module: create test/bitbucket/, add npm script in package.json, document module in TEST_MODULES.md (table entry + agent-core path mapping).",
"acceptance": [
"test/bitbucket/ directory exists",
"package.json has test:module:bitbucket script invoking MODULE=bitbucket jest --config jest.module.config.js",
"TEST_MODULES.md Modules table lists bitbucket; path-filter mapping includes src/webhook/bitbucket/** → bitbucket"
],
"depends_on": []
},
{
"id": "S2",
"summary": "Implement test/bitbucket/bitbucket.happy-path.e2e-spec.ts: boot AppModule, post pullrequest:created via BJ-15 client, poll WebhookDeliveryEntity + /internal/task phase transitions, assert BJ-16 mock request log (comment, PR create, merge), post pullrequest:fulfilled, assert task closed; cleanup in afterAll.",
"acceptance": [
"Scenario tagged @integration @bitbucket in describe block",
"Uses mock request log assertions for the full agent-core round-trip (comment, PR create, merge)",
"Both pullrequest:created and pullrequest:fulfilled deliveries succeed in WebhookDeliveryEntity",
"Final task state asserted as completed/closed",
"MODULE=bitbucket npm run test:module passes against testing (port 8777)"
],
"depends_on": [
"S1"
]
}
],
"risks": [
{
"risk": "BJ-10/BJ-11 (agent-core runtime) and BJ-15/BJ-16 (e2e fixtures + mock) still OPEN; imports and pipeline transitions will fail until they land.",
"mitigation": "Sequence implementation after all four prerequisites merge into rc/atlassian-integration; hold this task in agent-blocked if dispatched too early."
},
{
"risk": "Issue wording uses legacy 'tier 2d-bitbucket' naming; current repo uses module-based test organisation.",
"mitigation": "Use 'bitbucket' as the module name to match existing convention (intake, pm, review, etc.); document the mapping in the PR body."
}
],
"assumptions": [
"BJ-15 exposes a Bitbucket webhook client/helper importable from agent-core-e2e test code.",
"BJ-16 exposes an introspection API (e.g. atlassianMock.requests()) for per-test request log assertions.",
"agent-core exposes GET /internal/task/<id>?repo=… phase field for Bitbucket tasks, same shape as the GitHub intake flow.",
"The scenario runs against testing (port 8777) with the mock server booted via globalSetup — no changes to CI workflows are required in this task."
],
"open_questions": [
"Smoke vs integration tag: should this be @smoke (every PR) or @integration (on module-change)? Plan assumes @integration."
]
}