refactor(task-rubrics): share DEFAULT_RUBRIC between general and code types

This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 23:07:08 -04:00
1 parent c47050964a
commit adfcb59978
1 file changed
+14 -13
+14 -13
View File
@@ -18,6 +18,17 @@ export interface TaskRubric {
briefTemplate: string; 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<TaskType, TaskRubric> = { const RUBRICS: Record<TaskType, TaskRubric> = {
research: { research: {
requiredSections: ["research question", "methodology", "sources", "expected findings"], requiredSections: ["research question", "methodology", "sources", "expected findings"],
@@ -40,24 +51,14 @@ const RUBRICS: Record<TaskType, TaskRubric> = {
briefTemplate: briefTemplate:
"A management task brief should cover: Objective, Stakeholders, Timeline, and Success Metrics.", "A management task brief should cover: Objective, Stakeholders, Timeline, and Success Metrics.",
}, },
general: { general: DEFAULT_RUBRIC,
requiredSections: [], code: DEFAULT_RUBRIC,
qualityKeywords: [],
minDescriptionLength: 50,
briefTemplate: "",
},
code: {
requiredSections: [],
qualityKeywords: [],
minDescriptionLength: 50,
briefTemplate: "",
},
}; };
/** Returns the rubric for the given task type, defaulting to "general" for unknown values. */ /** Returns the rubric for the given task type, defaulting to "general" for unknown values. */
function getTaskTypeRubric(taskType: string): TaskRubric { function getTaskTypeRubric(taskType: string): TaskRubric {
const key = taskType as TaskType; const key = taskType as TaskType;
return RUBRICS[key] ?? RUBRICS.general; return RUBRICS[key] ?? DEFAULT_RUBRIC;
} }
/** /**