fix: keep qscore out of curator tasks
This commit is contained in:
@@ -102,6 +102,60 @@ type ServiceCurationPreviewInput = {
|
||||
userContext?: Partial<Awaited<ReturnType<typeof buildCuratorUserContext>>>;
|
||||
};
|
||||
|
||||
const CURATOR_TASK_SERVICE_FALLBACKS: Record<CuratorTaskType, CuratorServiceId> = {
|
||||
measurement: "assessment-service",
|
||||
proof: "resume-service",
|
||||
practice: "interview-service",
|
||||
recovery: "roleplay-service",
|
||||
};
|
||||
|
||||
function curatorAssignableServiceId(serviceId: CuratorServiceId, taskType: CuratorTaskType): CuratorServiceId {
|
||||
return serviceId === "qscore-service" ? CURATOR_TASK_SERVICE_FALLBACKS[taskType] : serviceId;
|
||||
}
|
||||
|
||||
function qscoreFreeTaskCopy(input: {
|
||||
serviceId: CuratorServiceId;
|
||||
taskType: CuratorTaskType;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
cta: string;
|
||||
signals: string[];
|
||||
}) {
|
||||
if (input.serviceId !== "qscore-service") {
|
||||
return {
|
||||
title: input.title,
|
||||
subtitle: input.subtitle,
|
||||
cta: input.cta,
|
||||
signals: input.signals,
|
||||
};
|
||||
}
|
||||
|
||||
if (input.taskType === "proof") {
|
||||
return {
|
||||
title: input.title.replace(/Q Score|QScore/gi, "resume proof"),
|
||||
subtitle: input.subtitle.replace(/Q Score|QScore/gi, "resume proof"),
|
||||
cta: "Open resume workspace",
|
||||
signals: input.signals.map((signal) => signal.replace(/q\s?score/gi, "resume proof")),
|
||||
};
|
||||
}
|
||||
|
||||
if (input.taskType === "practice") {
|
||||
return {
|
||||
title: input.title.replace(/Q Score|QScore/gi, "interview practice"),
|
||||
subtitle: input.subtitle.replace(/Q Score|QScore/gi, "interview practice"),
|
||||
cta: "Open interview preview",
|
||||
signals: input.signals.map((signal) => signal.replace(/q\s?score/gi, "interview practice")),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
title: input.title.replace(/Q Score|QScore/gi, "readiness assessment"),
|
||||
subtitle: input.subtitle.replace(/Q Score|QScore/gi, "the assessment service"),
|
||||
cta: "Open assessment",
|
||||
signals: input.signals.map((signal) => signal.replace(/q\s?score/gi, "assessment")),
|
||||
};
|
||||
}
|
||||
|
||||
const FRESHER_WEEK_TEMPLATES: WeekTemplate[] = [
|
||||
{
|
||||
theme: "Baseline + First Proof",
|
||||
@@ -811,7 +865,9 @@ function seed(
|
||||
cta: string,
|
||||
signals: string[],
|
||||
): TaskSeed {
|
||||
return { taskType, serviceId, title, subtitle, effort, qxImpact, cta, signals };
|
||||
const assignedServiceId = curatorAssignableServiceId(serviceId, taskType);
|
||||
const copy = qscoreFreeTaskCopy({ serviceId, taskType, title, subtitle, cta, signals });
|
||||
return { taskType, serviceId: assignedServiceId, title: copy.title, subtitle: copy.subtitle, effort, qxImpact, cta: copy.cta, signals: copy.signals };
|
||||
}
|
||||
|
||||
function todayIso(date = new Date()) {
|
||||
@@ -1792,7 +1848,7 @@ export async function listCuratorRegistryCapabilities() {
|
||||
title: mission.title,
|
||||
modules: mission.modules.map((module) => ({ id: module.id, title: module.title, service: module.service, role: module.role })),
|
||||
})),
|
||||
services: listServiceCapabilities(),
|
||||
services: listServiceCapabilities().filter((service) => service.id !== "qscore-service"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -497,13 +497,9 @@ export function buildCuratorTools(ctx: { userId: string; date: string; conversat
|
||||
}),
|
||||
|
||||
prepare_qscore_review: tool({
|
||||
description: "Prepare a Q-score review handoff.",
|
||||
description: "Disabled for curator task handoffs; QScore is read-only for dashboard scoring and should not be assigned as a curator task.",
|
||||
inputSchema: z.object({ taskId: z.string().optional() }),
|
||||
execute: async ({ taskId }) => {
|
||||
const task = await findTask(ctx.userId, taskId ?? ctx.taskId ?? "", ctx.date);
|
||||
if (!task) return { error: "task_not_found" };
|
||||
return prepareHandoffForTask(ctx.userId, task, "qscore-service");
|
||||
},
|
||||
execute: async () => ({ error: "qscore_curator_handoff_disabled", replacementServices: ["assessment-service", "interview-service", "roleplay-service", "resume-service", "matchmaking-service", "courses-service", "social-branding-service"] }),
|
||||
}),
|
||||
|
||||
emit_curator_event: tool({
|
||||
|
||||
Reference in New Issue
Block a user