AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-551
  5. changes
  6. pr_description.md
pr_description.md(2.4 KB)· Apr 24, 2026· 2 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

Title#

feat: tenant config routing — platform → service triple (BJ-11)

Problem#

Dispatch-path services (PhaseRouterService, PhaseHooksService, CompoundService) import GitHubService directly, making it impossible to route multi-platform events to the correct concrete service. This blocks Bitbucket/Jira dispatch in Wave 3.

Task / Link#

Closes #551 (BJ-11: Tenant config routing — platform → service triple)

Changes#

  • New src/tenant/platform-services.ts — PLATFORM_SERVICES injection token + PlatformServicesMap type
  • New src/tenant/tenant-config.service.spec.ts — unit tests for getPlatformServices() (happy path, unknown platform, missing platform)
  • Extend TenantConfigService.getPlatformServices(platform) — returns { service, adapter, authProvider } triple; throws BadRequestException on empty platform, NotFoundException on unknown platform
  • Promote AdapterRegistry to PlatformModule (providers + exports), removing it from WebhookModule to break potential circular dependency
  • Update TenantModule — registers PLATFORM_SERVICES factory { github: GitHubService }, imports PlatformModule
  • Refactor PhaseRouterService — drops GitHubService injection; routes validateCompoundScope through tenantConfig.getPlatformServices('github').service
  • Refactor PhaseHooksService and CompoundService — replace direct GitHubService injection with TenantConfigService; all GitHub calls now routed through getPlatformServices()
  • Update all three spec files to inject a TenantConfigService stub returning the service triple

Notes#

  • postFeedbackComment in PhaseRouterService continues to use PlatformServiceResolver (the minimal PlatformProvider interface), which handles the platform-agnostic postComment call already established in BJ-11 (PR #587). getPlatformServices() is complementary: it exposes the full concrete service for GitHub-specific methods not covered by PlatformProvider.
  • Typing service as GitHubService in the return type is intentional and temporary — PlatformProvider expansion to cover more methods is deferred to Wave 3 sibling tickets.

Testing#

  • npm run lint — zero warnings
  • npm run test — 994/994 passing (154 new/updated assertions in 4 spec files)
  • Grep audit: grep -r "from '../github/github.service'" src/phase-router src/hooks → zero matches
PrdAi-done