Task factory — turns Mentor's strategic parameters into concrete math problems by orchestrating LLM generation and template selection.
- Receive generation parameters from Mentor (type, difficulty, topic)
- Select task generation method (LLM via taskgen, or template DB)
- Assemble final task with metadata (hints, solution, difficulty)
- Serve tasks to UI via REST API
- Track task lifecycle (created → assigned → attempted → completed)
- Language: Go
- Framework: Gin (HTTP), GORM (ORM)
- Database: PostgreSQL (task templates, task instances)
- Events: Kafka pub/sub
- Inbound: REST API (GET /tasks/next, GET /tasks/{id}), HTTP invocation from UI
- Outbound: HTTP invoke → mathtrail-llm-taskgen (generate problem)
- Subscribes:
mentor.strategy.updated(receive generation parameters) - Publishes:
task.attempt.completed(notify Profile + Mentor)
- PostgreSQL: task_templates, task_instances, task_attempts
DB_PASSWORD— PostgreSQL password- Vault path:
secret/data/{env}/mathtrail-task/
Standard infra/ layout:
infra/helm/— Helm chart + environment overlays (dev, on-prem, cloud)infra/terraform/— Database module (K8s pod vs managed RDS)infra/ansible/— On-prem node preparation
just dev— Skaffold dev loopjust test— Go unit tests
- Define Task data model (templates, instances, attempts)
- Implement Kafka subscriber for
mentor.strategy.updated - Build REST API for task delivery (GET /tasks/next with difficulty filter)