diff --git a/src/main/task-rubrics.ts b/src/main/task-rubrics.ts index fc0e627c..6c94a55a 100644 --- a/src/main/task-rubrics.ts +++ b/src/main/task-rubrics.ts @@ -18,6 +18,17 @@ export interface TaskRubric { briefTemplate: string; } +/** + * Default rubric used by task types that carry no type-specific quality + * expectations. Single source of truth so "general" and "code" cannot drift. + */ +const DEFAULT_RUBRIC: TaskRubric = { + requiredSections: [], + qualityKeywords: [], + minDescriptionLength: 50, + briefTemplate: "", +}; + const RUBRICS: Record = { research: { requiredSections: ["research question", "methodology", "sources", "expected findings"], @@ -40,24 +51,14 @@ const RUBRICS: Record = { briefTemplate: "A management task brief should cover: Objective, Stakeholders, Timeline, and Success Metrics.", }, - general: { - requiredSections: [], - qualityKeywords: [], - minDescriptionLength: 50, - briefTemplate: "", - }, - code: { - requiredSections: [], - qualityKeywords: [], - minDescriptionLength: 50, - briefTemplate: "", - }, + general: DEFAULT_RUBRIC, + code: DEFAULT_RUBRIC, }; /** Returns the rubric for the given task type, defaulting to "general" for unknown values. */ function getTaskTypeRubric(taskType: string): TaskRubric { const key = taskType as TaskType; - return RUBRICS[key] ?? RUBRICS.general; + return RUBRICS[key] ?? DEFAULT_RUBRIC; } /**