{
"meta": {
"agent": "planner",
"task_id": "353",
"title": "MT-9: Extract hardcoded constants (org, labels) to TenantConfig",
"created_at": "2026-04-08T22:10:00Z"
},
"inputs": [
{
"name": "issue-353",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/353",
"notes": "Wave 2 config extraction — org + label strings"
},
{
"name": "constants.ts",
"type": "file",
"ref": "src/config/constants.ts",
"notes": "Contains GH_ORG and ARTEFACTS_REPO"
},
{
"name": "phase-hooks.service.ts",
"type": "file",
"ref": "src/hooks/phase-hooks.service.ts",
"notes": "5 hardcoded label strings, no org refs"
},
{
"name": "github.adapter.ts",
"type": "file",
"ref": "src/webhook/adapters/github.adapter.ts",
"notes": "3 in-refinement label comparisons"
},
{
"name": "artefacts.service.ts",
"type": "file",
"ref": "src/artefacts/artefacts.service.ts",
"notes": "5 GH_ORG usages for directory paths + 1 for ghRepo"
}
],
"outputs": [
{
"name": "plan",
"type": "spec",
"format": "md",
"content": "plan.md"
}
],
"files": [
{
"path": "src/config/constants.ts",
"action": "modify",
"reason": "Remove GH_ORG export, inline ARTEFACTS_REPO value"
},
{
"path": "src/hooks/phase-hooks.service.ts",
"action": "modify",
"reason": "Inject TenantConfigService, replace 5 hardcoded label strings"
},
{
"path": "src/hooks/phase-hooks.service.spec.ts",
"action": "modify",
"reason": "Add TenantConfigService mock"
},
{
"path": "src/webhook/adapters/github.adapter.ts",
"action": "modify",
"reason": "Inject TenantConfigService, replace 3 in-refinement comparisons"
},
{
"path": "src/webhook/adapters/github.adapter.spec.ts",
"action": "modify",
"reason": "Add TenantConfigService mock"
},
{
"path": "src/artefacts/artefacts.service.ts",
"action": "modify",
"reason": "Inject TenantConfigService, replace 6 GH_ORG usages"
},
{
"path": "src/artefacts/artefacts.service.spec.ts",
"action": "modify",
"reason": "Add TenantConfigService mock, update GH_ORG assertions"
},
{
"path": "src/hooks/hooks.module.ts",
"action": "modify",
"reason": "Import TenantConfigService"
},
{
"path": "src/webhook/webhook.module.ts",
"action": "modify",
"reason": "Import TenantConfigService"
}
],
"steps": [
{
"id": "S1",
"summary": "Remove GH_ORG from constants.ts and inline ARTEFACTS_REPO value",
"acceptance": [
"GH_ORG export no longer exists in constants.ts",
"ARTEFACTS_REPO uses inline 'AgentSDE/agent-core-artefacts' string",
"tsc --noEmit passes"
],
"depends_on": []
},
{
"id": "S2",
"summary": "Replace hardcoded labels and GH_ORG in phase-hooks.service.ts, github.adapter.ts, and artefacts.service.ts with TenantConfigService lookups",
"acceptance": [
"No hardcoded label strings in phase-hooks.service.ts",
"No hardcoded 'in-refinement' in github.adapter.ts",
"No GH_ORG imports in artefacts.service.ts",
"All replaced values read from TenantConfigService",
"Module files updated with TenantConfigService imports"
],
"depends_on": [
"S1"
]
},
{
"id": "S3",
"summary": "Update unit tests to provide TenantConfigService mocks with default values",
"acceptance": [
"phase-hooks.service.spec.ts provides TenantConfigService mock",
"github.adapter.spec.ts provides TenantConfigService mock",
"artefacts.service.spec.ts provides TenantConfigService mock",
"npm run test passes",
"npm run lint passes"
],
"depends_on": [
"S2"
]
}
],
"risks": [
{
"risk": "TenantConfigService (#348) not yet merged — interface shape may change",
"mitigation": "Implementation waits for #348; use interface as documented in issue"
},
{
"risk": "ARTEFACTS_REPO inlining creates second hardcoded 'AgentSDE' string",
"mitigation": "Acceptable per scope — ARTEFACTS_REPO is infrastructure, not tenant-specific"
}
],
"assumptions": [
"TenantConfigService from #348 exposes getConfig() returning { org: string, labels: { inRefinement, refined, inReview, agentBlocked } }",
"Default config values match current hardcoded values (same defaults = same behavior)",
"ARTEFACTS_REPO and ARTEFACTS_REPO_NAME remain as infrastructure constants"
],
"open_questions": []
}