{
"meta": {
"agent": "planner",
"task_id": "550",
"title": "BJ-10: ClaudeInvocationService platform-switched env",
"created_at": "2026-04-23T17:13:00Z"
},
"inputs": [
{
"name": "issue",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/550",
"notes": "BJ-10 — platform-switched env pass-through"
},
{
"name": "epic",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/539",
"notes": "EPIC: Bitbucket + Jira integration, Wave 3"
},
{
"name": "dep-BJ-0",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/540",
"notes": "Adds 'jira'/'bitbucket' to platform unions + TaskEntity.platform column (OPEN)"
},
{
"name": "dep-BJ-2",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/542",
"notes": "BitbucketOAuthAuthProvider (OPEN)"
},
{
"name": "dep-BJ-3",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/543",
"notes": "JiraOAuthAuthProvider (OPEN)"
},
{
"name": "service",
"type": "file",
"ref": "src/invoke/claude-invocation.service.ts",
"notes": "Current GitHub-only env pass-through, lines 67-91"
},
{
"name": "module",
"type": "file",
"ref": "src/invoke/invoke.module.ts",
"notes": "Imports GitHubModule for PLATFORM_AUTH_PROVIDER"
},
{
"name": "phase-router",
"type": "file",
"ref": "src/phase-router/phase-router.service.ts",
"notes": "buildEnv() at line 722 — consumer of invoke()"
}
],
"outputs": [
{
"name": "plan",
"type": "plan",
"format": "md",
"content": "see plan.md"
}
],
"files": [
{
"path": "src/invoke/claude-invocation.service.ts",
"action": "modify",
"reason": "Switch to multi-provider DI; branch env block on platform"
},
{
"path": "src/invoke/invoke.module.ts",
"action": "modify",
"reason": "Register PLATFORM_AUTH_PROVIDERS array with optional Atlassian providers"
},
{
"path": "src/phase-router/phase-router.service.ts",
"action": "modify",
"reason": "Pass task.platform through env.PLATFORM"
},
{
"path": "src/invoke/claude-invocation.service.spec.ts",
"action": "modify",
"reason": "Add bitbucket/jira/unknown-platform cases; keep GitHub regression"
},
{
"path": "src/platform/platform-auth-provider.interface.ts",
"action": "modify",
"reason": "Add PLATFORM_AUTH_PROVIDERS collection token"
}
],
"steps": [
{
"id": "S1",
"summary": "Add PLATFORM_AUTH_PROVIDERS token, wire InvokeModule factory, refactor ClaudeInvocationService to branch on platform, update phase-router, extend spec",
"acceptance": [
"ClaudeInvocationService injects PlatformAuthProvider[] via PLATFORM_AUTH_PROVIDERS and selects by .platform === env.PLATFORM",
"Unknown platform throws a descriptive Error at invocation time",
"github path emits identical queue payload env shape as before (regression test passes)",
"bitbucket selection emits BITBUCKET_TOKEN, BITBUCKET_BOT_USERNAME, BITBUCKET_WORKSPACE, BITBUCKET_REPO plus PLATFORM=bitbucket",
"jira selection emits JIRA_TOKEN, JIRA_BOT_USERNAME, JIRA_SITE_URL, JIRA_CLOUD_ID, JIRA_PROJECT_KEY plus PLATFORM=jira",
"authProvider.getToken() is invoked on every invoke() call (not cached at construction)",
"phase-router buildEnv() sets env.PLATFORM = task.platform ?? 'github'",
"npm run test, npm run lint, npm run build all green"
],
"depends_on": []
}
],
"risks": [
{
"risk": "BJ-0, BJ-2, BJ-3 are OPEN — TaskEntity.platform column and Atlassian providers do not yet exist on rc/atlassian-integration",
"mitigation": "Use optional DI for Atlassian tokens so module boots without them; default env.PLATFORM to 'github' so behaviour is unchanged until deps land"
},
{
"risk": "Existing callers outside the spec path may construct ClaudeInvocationService with positional args",
"mitigation": "Grep for `new ClaudeInvocationService(` before shipping; the only known caller is the spec file"
}
],
"assumptions": [
"Unknown task.platform should throw immediately rather than silently omitting credentials",
"BITBUCKET_AUTH_PROVIDER and JIRA_AUTH_PROVIDER tokens are exported from their respective modules (mirrors github.module.ts)",
"Tenant config values (BITBUCKET_WORKSPACE, JIRA_CLOUD_ID, etc.) are available via ConfigService passthrough in this ticket; per-tenant routing lands in BJ-11"
],
"open_questions": []
}