AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-349
  5. plan
  6. context.json
context.json(3.3 KB)· Apr 8, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "349",
    "title": "MT-5: Migrate PhaseHooksService from GitHubService to PlatformProvider",
    "created_at": "2026-04-08T12:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-349",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/349",
      "notes": "Wave 2 consumer migration — PhaseHooksService"
    },
    {
      "name": "phase-hooks.service.ts",
      "type": "file",
      "ref": "src/hooks/phase-hooks.service.ts",
      "notes": "374 lines, 10+ GitHubService call sites"
    },
    {
      "name": "phase-hooks.module.ts",
      "type": "file",
      "ref": "src/hooks/phase-hooks.module.ts",
      "notes": "Imports GitHubModule"
    },
    {
      "name": "phase-hooks.service.spec.ts",
      "type": "file",
      "ref": "src/hooks/phase-hooks.service.spec.ts",
      "notes": "528 lines, mocks GitHubService"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "plan",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": "src/hooks/phase-hooks.service.ts",
      "action": "modify",
      "reason": "Swap GitHubService injection for PlatformProvider; replace all call sites"
    },
    {
      "path": "src/hooks/phase-hooks.module.ts",
      "action": "modify",
      "reason": "Replace GitHubModule import with PlatformModule"
    },
    {
      "path": "src/hooks/phase-hooks.service.spec.ts",
      "action": "modify",
      "reason": "Update mock from GitHubService to PlatformProvider token"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Update phase-hooks.service.ts — swap constructor injection and all call sites from GitHubService to PlatformProvider",
      "acceptance": [
        "No import of GitHubService in phase-hooks.service.ts",
        "Constructor uses @Inject(PLATFORM_PROVIDER) private readonly platform: PlatformProvider",
        "All this.github.* calls replaced with this.platform.*",
        "setProjectItemStatus uses optional chaining (this.platform.setProjectItemStatus?.())"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Update phase-hooks.module.ts — replace GitHubModule import with PlatformModule",
      "acceptance": [
        "No import of GitHubModule in phase-hooks.module.ts",
        "PlatformModule is in the imports array"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Update phase-hooks.service.spec.ts — mock PlatformProvider instead of GitHubService",
      "acceptance": [
        "Mock provider uses PLATFORM_PROVIDER token",
        "Mock type is jest.Mocked<PlatformProvider>",
        "All existing tests pass unchanged (only mock wiring changes)"
      ],
      "depends_on": [
        "S1"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Blocked by #345 — PlatformProvider interface not yet on rc/multi-tenant",
      "mitigation": "Do not merge PR until #345 lands"
    },
    {
      "risk": "setProjectItemStatus optional typing mismatch",
      "mitigation": "Check PlatformProvider interface definition; adjust optional chaining if method is required on interface"
    }
  ],
  "assumptions": [
    "PlatformProvider interface exposes addLabel, removeLabel, postComment, mergePR, closeIssue, getCheckStatus, getReviewStatus, setProjectItemStatus with compatible signatures",
    "PlatformModule exports the PLATFORM_PROVIDER injection token",
    "CompoundService does not depend on GitHubService directly (confirmed — it has its own injection)"
  ]
}
Plan