AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-348
  5. plan
  6. context.json
context.json(3.7 KB)· Apr 8, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "348",
    "title": "MT-4: Create TenantConfig interfaces + TenantConfigService",
    "created_at": "2026-04-08T12:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-348",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/348",
      "notes": "MT-4 issue with full interface spec and acceptance criteria"
    },
    {
      "name": "config.schema.ts",
      "type": "file",
      "ref": "src/config/config.schema.ts",
      "notes": "Current ENV var validation — shows required/optional vars and defaults"
    },
    {
      "name": "constants.ts",
      "type": "file",
      "ref": "src/config/constants.ts",
      "notes": "GH_ORG hardcoded constant"
    },
    {
      "name": "github.adapter.ts",
      "type": "file",
      "ref": "src/webhook/adapters/github.adapter.ts",
      "notes": "Hardcoded label strings (in-refinement, backlog, etc.)"
    },
    {
      "name": "phase-router.service.ts",
      "type": "file",
      "ref": "src/phase-router/phase-router.service.ts",
      "notes": "Hardcoded branchPrefix='feat' and origin/master base"
    }
  ],
  "outputs": [
    {
      "name": "plan.md",
      "type": "plan",
      "format": "md",
      "content": "Implementation plan for TenantConfig interfaces and service"
    }
  ],
  "files": [
    {
      "path": "src/tenant/tenant-config.interface.ts",
      "action": "create",
      "reason": "TenantConfig and RepoConfig interface definitions"
    },
    {
      "path": "src/tenant/tenant-config.service.ts",
      "action": "create",
      "reason": "Service reading ConfigService + hardcoded defaults into TenantConfig"
    },
    {
      "path": "src/tenant/tenant.module.ts",
      "action": "create",
      "reason": "NestJS module providing and exporting TenantConfigService"
    },
    {
      "path": "src/tenant/tenant-config.service.spec.ts",
      "action": "create",
      "reason": "Unit tests for defaults, ConfigService reads, label values, missing var throws"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Create TenantConfig and RepoConfig interfaces in tenant-config.interface.ts",
      "acceptance": [
        "TenantConfig interface has all fields from issue spec: tenantId, org, platform, platformCredentialPath, botUsername, defaultBaseBranch, branchPrefix, labels, projectId, projectNumber, llmProvider, llmCredentialPath, llmModel, llmTimeoutSecs, defaultDirective",
        "RepoConfig extends Partial<TenantConfig> with repo and excludeFromAgent fields",
        "tsc --noEmit passes"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Create TenantConfigService with getConfig() method and constructor validation",
      "acceptance": [
        "getConfig() returns TenantConfig with correct defaults matching current runtime behavior",
        "Reads GITHUB_OWNER, AGENT_USERNAME, PROJECT_ID, PROJECT_NUMBER, CLAUDE_TIMEOUT_SECS from ConfigService",
        "Throws on construction if GITHUB_OWNER or AGENT_USERNAME is missing/empty",
        "Label defaults match: in-refinement, refined, in-review, agent-blocked, backlog"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Create TenantModule and unit tests",
      "acceptance": [
        "TenantModule provides and exports TenantConfigService",
        "Unit tests verify correct defaults, ConfigService reads, label values, and missing required var throws",
        "npm run test passes",
        "npm run lint passes"
      ],
      "depends_on": [
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Label string drift — hardcoded labels duplicated from github.adapter.ts",
      "mitigation": "Downstream issues will centralize label references through TenantConfigService"
    }
  ],
  "assumptions": [
    "No existing files need modification — only new files under src/tenant/",
    "Single-tenant implementation ignores org/repo params in getConfig() for now"
  ],
  "open_questions": []
}
Plan