AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-544
  5. plan
  6. context.json
context.json(3.5 KB)· Apr 23, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "544",
    "title": "BJ-4: Config schema — Bitbucket + Jira env blocks",
    "created_at": "2026-04-23T17:10:42Z"
  },
  "inputs": [
    {
      "name": "issue-544",
      "type": "link",
      "ref": "AgentSDE/agent-core#544",
      "notes": "Wave 1 of Atlassian Epic #539; depends on #540"
    },
    {
      "name": "existing-schema",
      "type": "file",
      "ref": "src/config/config.schema.ts",
      "notes": "Already contains GITHUB_APP_ID .when() conditional pattern to mirror"
    },
    {
      "name": "existing-spec",
      "type": "file",
      "ref": "src/config/config.schema.spec.ts",
      "notes": "Has GitHub App mode describe block to use as template"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "spec",
      "format": "md",
      "content": "plan.md"
    },
    {
      "name": "prd",
      "type": "spec",
      "format": "json",
      "content": "prd.json"
    }
  ],
  "files": [
    {
      "path": "src/config/config.schema.ts",
      "action": "modify",
      "reason": "Add 7 Bitbucket + 8 Jira Joi entries with CLIENT_ID-gated conditional validation"
    },
    {
      "path": "src/config/config.schema.spec.ts",
      "action": "modify",
      "reason": "Add Bitbucket mode and Jira mode describe blocks covering empty / partial-fail / complete-pass"
    },
    {
      "path": ".env.example",
      "action": "modify",
      "reason": "Document both new optional blocks with inline comments"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Extend config.schema.ts with Bitbucket + Jira Joi entries using .when() conditional pattern",
      "acceptance": [
        "BITBUCKET_OAUTH_CLIENT_SECRET/REFRESH_TOKEN/WORKSPACE require BITBUCKET_OAUTH_CLIENT_ID via Joi.when()",
        "JIRA_OAUTH_CLIENT_SECRET/REFRESH_TOKEN/SITE_URL/CLOUD_ID require JIRA_OAUTH_CLIENT_ID via Joi.when()",
        "BITBUCKET_REPO, *_BOT_USERNAME, *_WEBHOOK_SECRET, JIRA_PROJECT_KEY declared as plain Joi.string().optional()",
        "No changes to existing GITHUB_* entries"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Add Bitbucket mode and Jira mode describe blocks in config.schema.spec.ts",
      "acceptance": [
        "Empty Atlassian config case: validEnv alone passes (no error)",
        "Partial case: only CLIENT_ID set produces error listing the three/four missing companions",
        "Complete case: all required companions set passes",
        "All new tests pass via npm run test"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Append Bitbucket and Jira commented blocks to .env.example with inline trigger/companion comments",
      "acceptance": [
        "New '# --- Bitbucket (optional) ---' and '# --- Jira (optional) ---' sections present",
        "All new lines are commented out so defaults remain GitHub-only",
        "Inline comment on each trigger var notes the required companions"
      ],
      "depends_on": [
        "S1"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Only the CLIENT_ID triggers required-companion validation; setting only CLIENT_SECRET will not error",
      "mitigation": "Matches the repo's existing GITHUB_APP_ID pattern — intentional single-gateway design, documented in plan"
    }
  ],
  "assumptions": [
    "BITBUCKET_OAUTH_CLIENT_ID and JIRA_OAUTH_CLIENT_ID are the designated .when() triggers per the issue's 'required together with …' annotations",
    "REFRESH_TOKEN values are validated for presence only — format/length checks are out of scope per issue edge case note",
    "BITBUCKET_REPO / *_BOT_USERNAME / *_WEBHOOK_SECRET / JIRA_PROJECT_KEY stay plain .optional() at this phase"
  ],
  "open_questions": []
}
Plan