AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-350
  5. plan
  6. context.json
context.json(3.9 KB)· Apr 8, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "350",
    "title": "MT-6: Migrate DirectiveService from GitHubService to PlatformProvider",
    "created_at": "2026-04-08T22:10:00Z"
  },
  "inputs": [
    {
      "name": "issue-350",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/350",
      "notes": "MT-6 consumer migration — DirectiveService"
    },
    {
      "name": "directive.service.ts",
      "type": "file",
      "ref": "src/directive/directive.service.ts",
      "notes": "Uses GitHubService.closePR, deleteBranch; raw fetch for postRawComment"
    },
    {
      "name": "directive.module.ts",
      "type": "file",
      "ref": "src/directive/directive.module.ts",
      "notes": "Imports GitHubModule"
    },
    {
      "name": "directive.service.spec.ts",
      "type": "file",
      "ref": "src/directive/directive.service.spec.ts",
      "notes": "Mocks GitHubService with closePR/deleteBranch; uses global.fetch for comment assertions"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "spec",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": "src/directive/directive.service.ts",
      "action": "modify",
      "reason": "Swap GitHubService injection to PlatformProvider; replace closePR/deleteBranch/postRawComment calls"
    },
    {
      "path": "src/directive/directive.module.ts",
      "action": "modify",
      "reason": "Import PlatformModule instead of GitHubModule"
    },
    {
      "path": "src/directive/directive.service.spec.ts",
      "action": "modify",
      "reason": "Mock PLATFORM_PROVIDER token instead of GitHubService; replace global.fetch assertions"
    },
    {
      "path": "src/platform/platform-provider.interface.ts",
      "action": "modify",
      "reason": "Add closePR/deleteBranch/postComment if missing from interface"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Verify and gap-fill PlatformProvider interface with closePR, deleteBranch, postComment methods",
      "acceptance": [
        "PlatformProvider interface defines closePR(owner, repo, prNumber)",
        "PlatformProvider interface defines deleteBranch(owner, repo, branch)",
        "PlatformProvider interface defines postComment(repo, issueNumber, body)",
        "GitHubPlatformProvider implements all three methods"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Update directive.module.ts and directive.service.ts to use PlatformProvider",
      "acceptance": [
        "directive.module.ts imports PlatformModule, not GitHubModule",
        "directive.service.ts injects PLATFORM_PROVIDER, not GitHubService",
        "All closePR/deleteBranch calls use this.platform.*",
        "postRawComment replaced with this.platform.postComment",
        "No GitHubService or GitHubModule imports in any directive file"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Update directive.service.spec.ts to mock PlatformProvider instead of GitHubService",
      "acceptance": [
        "Test module provides PLATFORM_PROVIDER token with mock, not GitHubService",
        "Mock includes closePR, deleteBranch, and postComment methods",
        "All global.fetch comment assertions replaced with platformProvider.postComment assertions",
        "All existing tests pass",
        "tsc --noEmit passes",
        "npm run lint passes"
      ],
      "depends_on": [
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "PlatformProvider interface from #345 may not include closePR/deleteBranch/postComment",
      "mitigation": "Gap-fill step S1 adds missing methods before migration"
    },
    {
      "risk": "postRawComment uses raw fetch with ConfigService token — different error semantics than provider",
      "mitigation": "GitHubPlatformProvider.postComment must handle missing token gracefully"
    }
  ],
  "assumptions": [
    "#345 (PlatformProvider interface + GitHubPlatformProvider) is merged to rc/multi-tenant before implementation",
    "PlatformModule exports PLATFORM_PROVIDER token for consumer injection",
    "ConfigService token handling for GitHub API calls lives in GitHubPlatformProvider, not in consumers"
  ],
  "open_questions": []
}
Plan