AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-543
  5. plan
  6. context.json
context.json(4.1 KB)ยท Apr 23, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "543",
    "title": "BJ-3: JiraOAuthAuthProvider",
    "created_at": "2026-04-23T17:11:22Z"
  },
  "inputs": [
    {
      "name": "issue",
      "type": "link",
      "ref": "AgentSDE/agent-core#543",
      "notes": "Wave 1 of EPIC #539; depends on #540 (BJ-0) and #541 (BJ-1)"
    },
    {
      "name": "base-branch",
      "type": "link",
      "ref": "rc/atlassian-integration",
      "notes": "PR target branch per issue body"
    },
    {
      "name": "reference-provider",
      "type": "file",
      "ref": "src/github/github-app-auth.provider.ts",
      "notes": "Shape model for the concrete provider"
    },
    {
      "name": "reference-module",
      "type": "file",
      "ref": "src/github/github.module.ts",
      "notes": "useFactory + PLATFORM_AUTH_PROVIDER wiring pattern"
    },
    {
      "name": "auth-contract",
      "type": "file",
      "ref": "src/platform/platform-auth-provider.interface.ts",
      "notes": "PlatformAuthProvider interface to satisfy"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "spec",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": "src/atlassian/jira-oauth-auth.provider.ts",
      "action": "create",
      "reason": "Concrete JiraOAuthAuthProvider class"
    },
    {
      "path": "src/atlassian/jira-oauth-auth.provider.spec.ts",
      "action": "create",
      "reason": "Unit tests for the new provider"
    },
    {
      "path": "src/atlassian/jira.module.ts",
      "action": "create",
      "reason": "Gated factory registration under PLATFORM_AUTH_PROVIDER token"
    },
    {
      "path": "src/config/config.schema.ts",
      "action": "modify",
      "reason": "Add JIRA_* env vars (all optional; JIRA_OAUTH_CLIENT_ID is the feature gate)"
    },
    {
      "path": ".env.example",
      "action": "modify",
      "reason": "Document JIRA_* env vars"
    },
    {
      "path": "CLAUDE.md",
      "action": "modify",
      "reason": "Add atlassian module to Key modules list"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Add JIRA_* env vars to Joi schema and .env.example",
      "acceptance": [
        "configValidationSchema includes JIRA_OAUTH_CLIENT_ID, JIRA_OAUTH_CLIENT_SECRET, JIRA_OAUTH_REFRESH_TOKEN, JIRA_SITE_URL, JIRA_CLOUD_ID, JIRA_PROJECT_KEY, JIRA_BOT_USERNAME as optional strings",
        ".env.example documents all seven JIRA_* vars with placeholders",
        "App boots cleanly with none of the JIRA_* vars set"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Create JiraOAuthAuthProvider extending AtlassianOAuthAuthProvider with unit tests",
      "acceptance": [
        "Class declares `readonly platform = 'jira'` and passes `https://auth.atlassian.com/oauth/token` to the base class",
        "getBotUsername() returns JIRA_BOT_USERNAME from ConfigService",
        "getBotUsername() throws a descriptive error when JIRA_BOT_USERNAME is missing",
        "Spec covers: platform id, happy-path bot username, missing-config error, token endpoint forwarding",
        "If #541 is not yet merged, a minimal atlassian-oauth-auth.provider.ts stub is added locally per AGENTS.md Wave N guidance"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Create JiraModule with gated useFactory and update CLAUDE.md",
      "acceptance": [
        "JiraModule registers PLATFORM_AUTH_PROVIDER via useFactory returning JiraOAuthAuthProvider only when config.get('JIRA_OAUTH_CLIENT_ID') is truthy",
        "Module exports PLATFORM_AUTH_PROVIDER",
        "CLAUDE.md Key modules list mentions the new atlassian module",
        "npm run lint and npm run test pass with zero warnings"
      ],
      "depends_on": [
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "#541 base class not merged at implementation time",
      "mitigation": "Create minimal local AtlassianOAuthAuthProvider stub in src/atlassian/ per AGENTS.md; remove once #541 lands"
    },
    {
      "risk": "Duplicate PLATFORM_AUTH_PROVIDER token if JiraModule and GitHubModule imported in the same scope",
      "mitigation": "Keep JiraModule import local to Jira-only consumers; defer multi-platform routing to Wave 2"
    }
  ],
  "assumptions": [
    "AtlassianOAuthAuthProvider accepts a token endpoint URL via its constructor (standard OAuth base pattern)",
    "JIRA_BOT_USERNAME is the authoritative bot identity and does not need derivation from JIRA_CLOUD_ID"
  ],
  "open_questions": []
}
Plan