{
"meta": {
"agent": "planner",
"task_id": "459",
"title": "AW-13: Migrate from SqliteJobQueue to BullMQJobQueue and remove SQLite queue",
"created_at": "2026-04-13T12:00:00Z"
},
"inputs": [
{
"name": "Issue #459",
"type": "context",
"ref": "https://github.com/AgentSDE/agent-core/issues/459",
"notes": "AW-13 final delivery step for AW-10"
},
{
"name": "AGENTS.md",
"type": "context",
"ref": "AGENTS.md",
"notes": "Testing conventions, pipeline phase rules"
},
{
"name": "AW-10 Epic #456",
"type": "link",
"ref": "https://github.com/AgentSDE/agent-core/issues/456",
"notes": "Parent epic — dependency chain AW-11 → AW-12 → AW-13"
}
],
"outputs": [
{
"name": "plan.md",
"type": "plan",
"format": "md",
"content": "Implementation plan for BullMQ migration and SQLite queue removal"
}
],
"files": [
{
"path": "src/queue/queue.module.ts",
"action": "modify",
"reason": "Swap SqliteJobQueue → BullMQJobQueue provider"
},
{
"path": "src/queue/index.ts",
"action": "modify",
"reason": "Replace SqliteJobQueue export"
},
{
"path": "src/queue/sqlite-job-queue.ts",
"action": "delete",
"reason": "Remove SQLite queue implementation"
},
{
"path": "src/queue/sqlite-job-queue.spec.ts",
"action": "delete",
"reason": "Remove SQLite queue tests"
},
{
"path": "src/database/entities/job.entity.ts",
"action": "delete",
"reason": "Remove JobEntity (jobs table)"
},
{
"path": "src/database/entities/index.ts",
"action": "modify",
"reason": "Remove JobEntity export"
},
{
"path": "src/database/database.module.ts",
"action": "modify",
"reason": "Remove JobEntity from entities array"
},
{
"path": "src/database/database.module.spec.ts",
"action": "modify",
"reason": "Remove JobEntity references"
},
{
"path": "src/operational/operational.module.ts",
"action": "modify",
"reason": "Remove JobEntity import"
},
{
"path": "src/operational/operational.controller.ts",
"action": "modify",
"reason": "Replace JobEntity repo with BullMQ introspection"
},
{
"path": "src/operational/operational.controller.spec.ts",
"action": "modify",
"reason": "Update tests for new job endpoints"
},
{
"path": "src/control-api/control-api.module.ts",
"action": "modify",
"reason": "Remove JobEntity from forFeature"
},
{
"path": "src/control-api/controllers/jobs.controller.ts",
"action": "modify",
"reason": "Replace TypeORM queries with BullMQ queue API"
},
{
"path": "test/job-queue.e2e-spec.ts",
"action": "modify",
"reason": "Rewrite E2E for BullMQJobQueue"
},
{
"path": ".env.example",
"action": "modify",
"reason": "Remove JOB_QUEUE_DRIVER if present"
}
],
"steps": [
{
"id": "S1",
"summary": "Remove SqliteJobQueue and wire BullMQJobQueue in QueueModule",
"acceptance": [
"SqliteJobQueue class and spec files deleted",
"QueueModule provides BullMQJobQueue as JOB_QUEUE token",
"index.ts exports BullMQJobQueue instead of SqliteJobQueue",
"No import errors in queue module"
],
"depends_on": []
},
{
"id": "S2",
"summary": "Remove JobEntity from database layer and all consumer modules",
"acceptance": [
"job.entity.ts deleted",
"JobEntity removed from database.module.ts entities array",
"JobEntity removed from entities/index.ts",
"JobEntity removed from operational.module.ts, control-api.module.ts",
"JobEntity removed from all spec files that import it for TypeORM setup",
"database.module.spec.ts job creation test removed"
],
"depends_on": [
"S1"
]
},
{
"id": "S3",
"summary": "Adapt jobs controller and operational endpoints to use BullMQ queue introspection",
"acceptance": [
"jobs.controller.ts queries BullMQ queue instead of JobEntity repo",
"operational.controller.ts job-related endpoints updated or removed",
"Corresponding spec files updated and passing"
],
"depends_on": [
"S2"
]
},
{
"id": "S4",
"summary": "Update E2E tests and clean up config",
"acceptance": [
"test/job-queue.e2e-spec.ts tests BullMQJobQueue with real Redis",
"JOB_QUEUE_DRIVER removed from config schema and .env.example if present",
"npm run lint passes with zero warnings",
"npm run test passes",
"npm run build succeeds",
"grep -r SqliteJobQueue src/ returns zero results"
],
"depends_on": [
"S3"
]
}
],
"risks": [
{
"risk": "AW-11 not yet implemented — BullMQJobQueue class does not exist",
"mitigation": "This issue is blocked until AW-11 (#457) merges; plan assumes BullMQJobQueue implements the existing JobQueue interface"
},
{
"risk": "Jobs controller API shape change may break control-plane consumers",
"mitigation": "Maintain same response shape via adapter mapping if backwards compatibility is required"
}
],
"assumptions": [
"AW-11 (#457) will create BullMQJobQueue implementing the existing JobQueue interface with enqueue() and onJob() methods",
"AW-12 (#458) will verify route() idempotency before this work begins",
"Redis infrastructure (REDIS_HOST, REDIS_PORT, REDIS_DB) is already configured from AW-1/AW-2 work",
"The SQLite jobs table can be dropped without migration — TypeORM synchronize handles schema"
],
"open_questions": [
"Should GET /api/jobs maintain backwards-compatible response shape or accept a breaking change?"
]
}