PRM-88 add CareerSprint report KPI backend

This commit is contained in:
Sai-karthik
2026-07-05 11:43:08 +00:00
parent d252077135
commit 9062ce9f22
5 changed files with 496 additions and 2 deletions
+27 -1
View File
@@ -5,7 +5,7 @@ import { requireUser, type AuthContext } from "../../auth/clerk.js";
import { config } from "../../config.js";
import type { Registry } from "../../actors/registry.js";
import { curatorService } from "./curator-actor.js";
import { buildCuratorSprint, buildCuratorTasks } from "./curator-store.js";
import { buildCuratorSprint, buildCuratorSprintReport, buildCuratorTasks } from "./curator-store.js";
let _client: Client<Registry> | null = null;
function getClient(): Client<Registry> {
@@ -73,6 +73,32 @@ export function v1CuratorRoutes() {
}));
});
app.get("/sprint/report", async (c) => {
const userId = c.get("userId");
const icpQuery = c.req.query("icpId");
const dayQuery = c.req.query("dayIndex");
const icpId = curationPreviewSchema.shape.icpId.safeParse(icpQuery).success ? icpQuery as NonNullable<z.infer<typeof curationPreviewSchema>["icpId"]> : undefined;
const dayIndex = dayQuery ? Number.parseInt(dayQuery, 10) : undefined;
return c.json(await buildCuratorSprintReport(userId, c.req.query("date"), {
icpId,
dayIndex: Number.isFinite(dayIndex) ? dayIndex : undefined,
}));
});
app.post("/sprint/report/generate", async (c) => {
const userId = c.get("userId");
const body = z.object({
date: z.string().optional(),
icpId: curationPreviewSchema.shape.icpId.optional(),
dayIndex: z.number().int().min(1).max(30).optional(),
}).parse(await c.req.json().catch(() => ({})));
return c.json(await buildCuratorSprintReport(userId, body.date, {
icpId: body.icpId,
dayIndex: body.dayIndex,
save: true,
}));
});
app.post("/curation/preview", async (c) => {
const userId = c.get("userId");
const body = curationPreviewSchema.parse(await c.req.json().catch(() => ({})));
+172 -1
View File
@@ -1,6 +1,6 @@
import { and, desc, eq, gte, inArray, sql } from "drizzle-orm";
import { db } from "../../db/client.js";
import { growEvents, growQscoreProjectionState } from "../../db/schema.js";
import { growEvents, growQscoreProjectionState, missionArtifacts } from "../../db/schema.js";
import { listMissionDefinitions } from "../../missions/registry.js";
import { listServiceCapabilities } from "../../workflows/service-capabilities.js";
import { emitCuratorEvent } from "./curator-events.js";
@@ -11,7 +11,10 @@ import type {
CuratorPlan,
CuratorPlanDay,
CuratorImprovementSignal,
CuratorKpiReportItem,
CuratorOutcomeReportItem,
CuratorServiceId,
CuratorSprintReport,
CuratorSprintResponse,
CuratorStreak,
CuratorTask,
@@ -20,6 +23,8 @@ import type {
} from "./curator-types.js";
import { buildCuratorTaskDeepLink, completionEventsForService, serviceName, serviceToolName } from "./curator-service-links.js";
import { normalizeActiveCuratorTaskSeed, seed, templateSetFor, type CuratorIcpTemplateSet, type TaskSeed, type WeekTemplate } from "./task-registry.js";
import { kpiDefinitionsForIcp } from "./kpi-registry.js";
import { outcomeDefinitionsForIcp } from "./outcome-report-registry.js";
const VALID_COMPLETION_TYPES = [
"service.completed",
@@ -891,6 +896,21 @@ type CuratorSprintBuildOptions = {
dayIndex?: number;
};
type CuratorSprintReportBuildOptions = CuratorSprintBuildOptions & {
save?: boolean;
};
const CAREERSPRINT_REPORT_ARTIFACT_TYPE = "careersprint_report";
const REPORT_DAY_COUNT = 7;
const TERMINAL_REPORT_STATUSES: CuratorTask["status"][] = [
"completed",
"blocked",
"partial",
"skipped",
"abandoned",
];
async function buildCuratorSprintInternal(userId: string, focusDate = todayIso(), options: CuratorSprintBuildOptions = {}): Promise<CuratorSprintResponse> {
const demoDayIndex = options.dayIndex ? clamp(options.dayIndex, 1, SPRINT_DURATION_DAYS) : undefined;
const demoStartDate = demoDayIndex ? addDaysIso(focusDate, -(demoDayIndex - 1)) : focusDate;
@@ -1022,6 +1042,157 @@ export async function buildCuratorSprint(userId: string, date = todayIso(), opti
return buildCuratorSprintInternal(userId, date, options);
}
function taskIsTerminalForReport(task: CuratorTask) {
return TERMINAL_REPORT_STATUSES.includes(task.status);
}
function taskEvidenceForKpi(task: CuratorTask) {
if (!task.serviceId || !taskIsTerminalForReport(task)) return null;
return {
serviceId: task.serviceId,
taskId: task.id,
status: task.status,
};
}
function computeReportEligibility(sprint: CuratorSprintResponse) {
const firstSevenDays = sprint.plan.days.slice(0, REPORT_DAY_COUNT);
if (sprint.activeDayIndex < REPORT_DAY_COUNT) {
return { eligible: false, reason: "Report unlocks after Day 7 of the static sprint." };
}
if (firstSevenDays.length < REPORT_DAY_COUNT) {
return { eligible: false, reason: "Seven static sprint days are not available yet." };
}
const tasks = firstSevenDays.flatMap((day) => day.tasks);
if (tasks.length < REPORT_DAY_COUNT * 4) {
return { eligible: false, reason: "Seven-day task evidence is still being prepared." };
}
if (!tasks.every(taskIsTerminalForReport)) {
return { eligible: false, reason: "Finish or close all Day 1-7 tasks to unlock the report." };
}
return { eligible: true, reason: "Seven-day sprint evidence is ready." };
}
function computeReportKpis(icpId: CuratorIcpId, tasks: CuratorTask[]): CuratorKpiReportItem[] {
return kpiDefinitionsForIcp(icpId).map((definition) => {
const evidence = tasks
.filter((task) => {
if (!task.serviceId || !definition.requiredServiceIds.includes(task.serviceId)) return false;
if (definition.requiredTaskTypes?.length && !definition.requiredTaskTypes.includes(task.taskType)) return false;
return taskIsTerminalForReport(task);
})
.map(taskEvidenceForKpi)
.filter((item): item is NonNullable<ReturnType<typeof taskEvidenceForKpi>> => Boolean(item));
const met = evidence.some((item) => item.status === "completed");
return {
id: definition.id,
category: definition.category,
label: definition.label,
met,
evidence,
};
});
}
function computeReportOutcomes(icpId: CuratorIcpId, kpis: CuratorKpiReportItem[]): CuratorOutcomeReportItem[] {
const metKpiIds = new Set(kpis.filter((kpi) => kpi.met).map((kpi) => kpi.id));
return outcomeDefinitionsForIcp(icpId).map((definition) => ({
id: definition.id,
text: definition.text,
requiredKpiIds: definition.requiredKpiIds,
met: definition.requiredKpiIds.every((kpiId) => metKpiIds.has(kpiId)),
}));
}
function reportFromArtifact(metadata: Record<string, unknown> | null | undefined): CuratorSprintReport | null {
const report = metadata?.report;
if (!report || typeof report !== "object") return null;
return { ...(report as CuratorSprintReport), saved: true };
}
async function loadSavedSprintReport(userId: string, sprintId: string): Promise<CuratorSprintReport | null> {
const [artifact] = await db
.select({ metadata: missionArtifacts.metadata })
.from(missionArtifacts)
.where(and(
eq(missionArtifacts.userId, userId),
eq(missionArtifacts.missionInstanceId, sprintId),
eq(missionArtifacts.type, CAREERSPRINT_REPORT_ARTIFACT_TYPE),
))
.orderBy(desc(missionArtifacts.updatedAt))
.limit(1);
return reportFromArtifact(artifact?.metadata);
}
async function saveSprintReport(report: CuratorSprintReport) {
await db.insert(missionArtifacts).values({
userId: report.userId,
missionInstanceId: report.sprintId,
missionId: "curator-sprint",
stageId: "careersprint-report",
serviceId: "qscore-service",
externalId: `${report.sprintId}:report`,
type: CAREERSPRINT_REPORT_ARTIFACT_TYPE,
title: `${report.icpLabel} CareerSprint report`,
status: report.eligible ? "ready" : "blocked",
summary: report.eligible ? "Seven-day CareerSprint report generated." : report.eligibilityReason,
metadata: { report: { ...report, saved: true } },
});
}
export async function buildCuratorSprintReport(
userId: string,
date = todayIso(),
options: CuratorSprintReportBuildOptions = {},
): Promise<CuratorSprintReport> {
const demoDayIndex = options.dayIndex ? clamp(options.dayIndex, 1, SPRINT_DURATION_DAYS) : undefined;
const demoStartDate = demoDayIndex ? addDaysIso(date, -(demoDayIndex - 1)) : date;
const sprintState = options.icpId
? {
startDate: demoStartDate,
variantId: options.icpId,
planDays: planSeedsForVariant(templateSetFor(options.icpId), demoStartDate),
}
: await loadSprintState(userId, date);
const sprint = await buildCuratorSprintInternal(userId, date, options);
const savedReport = options.save || options.icpId ? null : await loadSavedSprintReport(userId, sprint.sprintId);
if (savedReport && savedReport.icpId === sprintState.variantId) return savedReport;
const templateSet = templateSetFor(sprintState.variantId);
const firstSevenDays = sprint.plan.days.slice(0, REPORT_DAY_COUNT);
const reportTasks = firstSevenDays.flatMap((day) => day.tasks);
const eligibility = computeReportEligibility(sprint);
const kpis = computeReportKpis(sprintState.variantId, reportTasks);
const outcomes = computeReportOutcomes(sprintState.variantId, kpis);
const report: CuratorSprintReport = {
userId,
icpId: sprintState.variantId,
icpLabel: templateSet.label,
sprintId: sprint.sprintId,
generatedAt: new Date().toISOString(),
saved: false,
eligible: eligibility.eligible,
eligibilityReason: eligibility.reason,
days: firstSevenDays.map((day) => ({
dayIndex: day.dayIndex,
title: day.focus ?? `Day ${day.dayIndex}`,
outcome: day.outcome ?? "Daily outcome captured.",
completedCount: day.completedCount,
totalCount: day.totalCount,
})),
kpis,
outcomes,
};
if (options.save) {
await saveSprintReport(report);
return { ...report, saved: true };
}
return report;
}
export async function buildServiceCurationPreview(input: ServiceCurationPreviewInput) {
const startDate = input.startDate ?? todayIso();
const inferredIcpId = input.icpId ?? await inferIcpVariant(input.userId);
+46
View File
@@ -145,6 +145,48 @@ export const curatorSprintResponseSchema = z.object({
source: z.literal("curator-v1"),
});
export const curatorKpiEvidenceSchema = z.object({
serviceId: curatorServiceIdSchema.optional(),
taskId: z.string().optional(),
eventId: z.string().optional(),
status: curatorTaskStatusSchema.optional(),
});
export const curatorKpiReportItemSchema = z.object({
id: z.string(),
category: z.string(),
label: z.string(),
met: z.boolean(),
evidence: z.array(curatorKpiEvidenceSchema),
});
export const curatorOutcomeReportItemSchema = z.object({
id: z.string(),
text: z.string(),
met: z.boolean(),
requiredKpiIds: z.array(z.string()),
});
export const curatorSprintReportSchema = z.object({
userId: z.string(),
icpId: z.string(),
icpLabel: z.string(),
sprintId: z.string(),
generatedAt: z.string(),
saved: z.boolean().default(false),
eligible: z.boolean(),
eligibilityReason: z.string(),
days: z.array(z.object({
dayIndex: z.number().int().min(1),
title: z.string(),
outcome: z.string(),
completedCount: z.number().int().min(0),
totalCount: z.number().int().min(0),
})),
kpis: z.array(curatorKpiReportItemSchema),
outcomes: z.array(curatorOutcomeReportItemSchema),
});
export type CuratorTask = z.infer<typeof curatorTaskSchema>;
export type CuratorPlanDay = z.infer<typeof curatorPlanDaySchema>;
export type CuratorWeek = z.infer<typeof curatorWeekSchema>;
@@ -152,6 +194,10 @@ export type CuratorPlan = z.infer<typeof curatorPlanSchema>;
export type CuratorStreak = z.infer<typeof curatorStreakSchema>;
export type CuratorImprovementSignal = z.infer<typeof curatorImprovementSignalSchema>;
export type CuratorSprintResponse = z.infer<typeof curatorSprintResponseSchema>;
export type CuratorKpiEvidence = z.infer<typeof curatorKpiEvidenceSchema>;
export type CuratorKpiReportItem = z.infer<typeof curatorKpiReportItemSchema>;
export type CuratorOutcomeReportItem = z.infer<typeof curatorOutcomeReportItemSchema>;
export type CuratorSprintReport = z.infer<typeof curatorSprintReportSchema>;
export type CuratorTodayResponse = {
date: string;
+150
View File
@@ -0,0 +1,150 @@
import type { CuratorIcpId } from "./icp-registry.js";
import type { CuratorServiceId, CuratorTaskType } from "./curator-types.js";
export type CuratorKpiDefinition = {
id: string;
icpId: CuratorIcpId;
category: string;
label: string;
requiredServiceIds: CuratorServiceId[];
requiredTaskTypes?: CuratorTaskType[];
acceptableCompletionEvents: string[];
outcomeIds: string[];
};
type KpiSeed = {
key: string;
category: string;
label: string;
requiredServiceIds: CuratorServiceId[];
requiredTaskTypes?: CuratorTaskType[];
acceptableCompletionEvents?: string[];
};
const DEFAULT_COMPLETION_EVENTS = [
"curator.task.completed",
"service.completed",
"qscore.updated",
"qscore.signal.projected",
"resume.analysis.completed",
"resume.parsed",
"resume.updated",
"resume.exported",
"interview.session.configured",
"interview.session.completed",
"interview.feedback.generated",
"roleplay.scenario.configured",
"roleplay.scenario.completed",
"roleplay.feedback.generated",
"assessment.completed",
"course.completed",
"course.lesson.completed",
"matchmaking.matches.generated",
"matchmaking.feed.viewed",
"matchmaking.match.saved",
"matchmaking.application.completed",
"brand.post.exported",
"brand.profile.updated",
];
const COMMON_KPI_KEYS = {
branding: ["social-branding-service"] as CuratorServiceId[],
intelligence: ["qscore-service", "assessment-service"] as CuratorServiceId[],
assets: ["resume-service", "cover-letter-service"] as CuratorServiceId[],
interview: ["interview-service", "roleplay-service"] as CuratorServiceId[],
learning: ["courses-service"] as CuratorServiceId[],
networking: ["expert-service", "events-service"] as CuratorServiceId[],
opportunity: ["matchmaking-service"] as CuratorServiceId[],
strategy: ["resume-service"] as CuratorServiceId[],
};
function kpis(icpId: CuratorIcpId, seeds: KpiSeed[]): CuratorKpiDefinition[] {
return seeds.map((seed) => ({
id: `${icpId}:${seed.key}`,
icpId,
category: seed.category,
label: seed.label,
requiredServiceIds: seed.requiredServiceIds,
requiredTaskTypes: seed.requiredTaskTypes,
acceptableCompletionEvents: seed.acceptableCompletionEvents ?? DEFAULT_COMPLETION_EVENTS,
outcomeIds: [`${icpId}:${seed.key}`],
}));
}
export const CURATOR_KPI_REGISTRY: Record<CuratorIcpId, CuratorKpiDefinition[]> = {
student_recent_grad: kpis("student_recent_grad", [
{ key: "branding", category: "Professional Branding", label: "GrowQR profile and LinkedIn profile completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Career Intelligence", label: "QX Score baseline established and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Career Assets", label: "Resume, cover letter and academic portfolio completed", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "interview", category: "Interview Readiness", label: "Mock interview and communication practice completed", requiredServiceIds: COMMON_KPI_KEYS.interview },
{ key: "learning", category: "Learning", label: "One AI-recommended course completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One mentor session and one GrowQR event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "AI-recommended internships or graduate roles reviewed and at least three opportunities saved or applied for", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Career Strategy", label: "AI-generated Career Growth Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
intern: kpis("intern", [
{ key: "branding", category: "Professional Branding", label: "GrowQR profile and LinkedIn profile completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Career Intelligence", label: "QX Score baseline established and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Career Assets", label: "Resume, cover letter and project portfolio completed", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "interview", category: "Interview Readiness", label: "HR interview and workplace simulation completed", requiredServiceIds: COMMON_KPI_KEYS.interview },
{ key: "learning", category: "Learning", label: "One personalized learning pathway completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One mentor session and one GrowQR event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "AI-matched roles reviewed and at least three applications submitted", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Career Strategy", label: "AI-generated Career Advancement Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
fresher_early_professional: kpis("fresher_early_professional", [
{ key: "branding", category: "Professional Branding", label: "GrowQR profile and LinkedIn profile completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Career Intelligence", label: "QX Score baseline established and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Career Assets", label: "Resume, cover letter and project portfolio completed", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "interview", category: "Interview Readiness", label: "Mock interview and workplace simulation completed", requiredServiceIds: COMMON_KPI_KEYS.interview },
{ key: "learning", category: "Learning", label: "One recommended course completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One mentor session and one career event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "AI-recommended jobs reviewed and at least three applications submitted", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Career Strategy", label: "AI-generated Career Growth Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
experienced_professional: kpis("experienced_professional", [
{ key: "branding", category: "Executive Branding", label: "Executive profile, leadership bio and thought leadership completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Leadership Intelligence", label: "Executive QX Score baseline and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Career Assets", label: "Executive resume, leadership portfolio and achievement documentation completed", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "interview", category: "Leadership Readiness", label: "Executive interview and boardroom simulations completed", requiredServiceIds: COMMON_KPI_KEYS.interview },
{ key: "learning", category: "Learning", label: "Executive leadership course completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One executive mentor session and one leadership event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "Senior leadership and advisory opportunities reviewed", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Growth Strategy", label: "AI-generated Executive Leadership Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
freelancer: kpis("freelancer", [
{ key: "branding", category: "Personal Branding", label: "Freelancer profile and service page completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Business Intelligence", label: "Freelancer QX Score baseline and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Portfolio & Proof", label: "Portfolio, case study and proposal templates created", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "interview", category: "Client Readiness", label: "Client pitch and negotiation simulations completed", requiredServiceIds: COMMON_KPI_KEYS.interview },
{ key: "learning", category: "Learning", label: "One freelancer business course completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One mentor consultation and one networking event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "AI-recommended client opportunities reviewed and shortlisted", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Growth Strategy", label: "AI-generated Client Growth Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
founder: kpis("founder", [
{ key: "branding", category: "Founder Brand", label: "Founder profile and startup page completed", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Venture Intelligence", label: "Founder QX Score baseline and Dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "assets", category: "Business Proof", label: "Founder story, pitch deck and MVP portfolio completed", requiredServiceIds: COMMON_KPI_KEYS.assets },
{ key: "validation", category: "Customer Validation", label: "Customer discovery conversations completed", requiredServiceIds: ["roleplay-service"] },
{ key: "interview", category: "Investor Readiness", label: "Investor pitch practiced and refined", requiredServiceIds: ["interview-service", "roleplay-service"] },
{ key: "learning", category: "Learning", label: "Founder capability course completed", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "networking", category: "Networking", label: "One mentor session and one founder event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "opportunity", category: "Opportunity Pipeline", label: "Customer, investor and partnership opportunities identified", requiredServiceIds: COMMON_KPI_KEYS.opportunity },
{ key: "strategy", category: "Growth Strategy", label: "AI-generated Startup Growth Blueprint completed", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
enterprise: kpis("enterprise", [
{ key: "branding", category: "Employer Branding", label: "Employer profile updated and employer branding campaign launched", requiredServiceIds: COMMON_KPI_KEYS.branding },
{ key: "intelligence", category: "Workforce Intelligence", label: "Enterprise QX Score baseline and capability dashboard activated", requiredServiceIds: COMMON_KPI_KEYS.intelligence },
{ key: "capability", category: "Capability Development", label: "Competency framework, learning paths and succession plans created", requiredServiceIds: ["resume-service", "courses-service"] },
{ key: "hiring", category: "Hiring Excellence", label: "Standardized interview process and AI-assisted hiring toolkit deployed", requiredServiceIds: ["resume-service", "roleplay-service"] },
{ key: "leadership", category: "Leadership Development", label: "Leadership simulations and coaching sessions completed", requiredServiceIds: ["roleplay-service"] },
{ key: "learning", category: "Learning", label: "Enterprise learning journeys assigned to teams", requiredServiceIds: COMMON_KPI_KEYS.learning },
{ key: "expert", category: "Expert Engagement", label: "At least one expert consultation and one enterprise event attended", requiredServiceIds: COMMON_KPI_KEYS.networking },
{ key: "strategy", category: "Strategic Output", label: "Workforce Transformation Blueprint generated", requiredServiceIds: COMMON_KPI_KEYS.strategy, requiredTaskTypes: ["proof"] },
]),
};
export function kpiDefinitionsForIcp(icpId: CuratorIcpId) {
return CURATOR_KPI_REGISTRY[icpId] ?? CURATOR_KPI_REGISTRY.fresher_early_professional;
}
+101
View File
@@ -0,0 +1,101 @@
import type { CuratorIcpId } from "./icp-registry.js";
export type CuratorOutcomeDefinition = {
id: string;
icpId: CuratorIcpId;
text: string;
requiredKpiIds: string[];
};
type OutcomeSeed = {
key: string;
text: string;
requiredKpiKeys?: string[];
};
function outcomes(icpId: CuratorIcpId, seeds: OutcomeSeed[]): CuratorOutcomeDefinition[] {
return seeds.map((seed) => ({
id: `${icpId}:${seed.key}`,
icpId,
text: seed.text,
requiredKpiIds: (seed.requiredKpiKeys ?? [seed.key]).map((key) => `${icpId}:${key}`),
}));
}
export const CURATOR_OUTCOME_REPORT_REGISTRY: Record<CuratorIcpId, CuratorOutcomeDefinition[]> = {
student_recent_grad: outcomes("student_recent_grad", [
{ key: "branding", text: "Professional GrowQR profile showcasing academic achievements and career aspirations." },
{ key: "intelligence", text: "Measurable QX Score with clear insights into career readiness." },
{ key: "assets", text: "ATS-ready resume, personalized cover letter and academic project portfolio." },
{ key: "interview", text: "Increased confidence through AI-powered interview practice and workplace simulations." },
{ key: "learning", text: "Personalized learning recommendations based on identified skill gaps." },
{ key: "networking", text: "Guidance from mentors and access to professional networking opportunities." },
{ key: "opportunity", text: "Curated list of internships, graduate programs and entry-level roles aligned with career goals." },
{ key: "strategy", text: "AI-generated Career Growth Blueprint outlining the next 30-90 days of development and application strategy." },
]),
intern: outcomes("intern", [
{ key: "branding", text: "Polished professional profile highlighting internship and early work experience." },
{ key: "intelligence", text: "Measurable QX Score with actionable career intelligence." },
{ key: "assets", text: "ATS-optimized resume, tailored cover letter and project portfolio." },
{ key: "interview", text: "Improved confidence through AI-powered interview coaching and workplace roleplays." },
{ key: "learning", text: "Personalized learning recommendations to close career-critical skill gaps." },
{ key: "networking", text: "Connections with mentors, recruiters and industry professionals." },
{ key: "opportunity", text: "Curated pipeline of relevant early-career opportunities." },
{ key: "strategy", text: "AI-generated Career Advancement Blueprint with clear next steps for securing interviews and accelerating professional growth." },
]),
fresher_early_professional: outcomes("fresher_early_professional", [
{ key: "branding", text: "Complete professional profile and stronger personal brand." },
{ key: "intelligence", text: "Measurable QX Score with clear employability insights." },
{ key: "assets", text: "ATS-ready resume, tailored cover letter and project portfolio." },
{ key: "interview", text: "Improved interview confidence through AI coaching and roleplay." },
{ key: "learning", text: "Personalized learning recommendations based on skill gaps." },
{ key: "networking", text: "Guidance from industry experts and professional mentors." },
{ key: "opportunity", text: "Active pipeline of job opportunities and recruiter connections." },
{ key: "strategy", text: "AI-generated Career Growth Blueprint with practical next steps for securing interviews and job offers." },
]),
experienced_professional: outcomes("experienced_professional", [
{ key: "branding", text: "Compelling executive profile and leadership brand." },
{ key: "intelligence", text: "Measurable Executive QX Score with leadership intelligence insights." },
{ key: "assets", text: "Polished executive resume, leadership portfolio and business impact documentation." },
{ key: "interview", text: "Increased confidence in executive interviews, negotiations and boardroom communication." },
{ key: "learning", text: "Personalized leadership learning recommendations." },
{ key: "networking", text: "Strategic relationships with mentors, executive communities and industry experts." },
{ key: "opportunity", text: "Curated pipeline of senior leadership, consulting and board opportunities." },
{ key: "strategy", text: "AI-generated Executive Leadership Growth Blueprint outlining the next phase of career advancement." },
]),
freelancer: outcomes("freelancer", [
{ key: "branding", text: "Compelling freelancer profile and professional brand." },
{ key: "intelligence", text: "Measurable Freelancer QX Score with business readiness insights." },
{ key: "assets", text: "Polished portfolio, proposal templates and client case studies." },
{ key: "interview", text: "Improved confidence in client discovery, pitching and negotiations." },
{ key: "learning", text: "Personalized learning recommendations for growing a freelance business." },
{ key: "networking", text: "Stronger networking through mentors and GrowQR community events." },
{ key: "opportunity", text: "Active pipeline of freelance projects and collaboration opportunities." },
{ key: "strategy", text: "AI-generated Business Growth Blueprint with actionable recommendations for attracting better clients and increasing recurring revenue." },
]),
founder: outcomes("founder", [
{ key: "branding", text: "Compelling founder profile and personal brand." },
{ key: "intelligence", text: "Measurable Founder QX Score and startup readiness dashboard." },
{ key: "assets", text: "Polished pitch deck, founder story and business portfolio." },
{ key: "validation", text: "Customer discovery insights and validated value proposition." },
{ key: "interview", text: "AI-coached investor and customer pitch confidence." },
{ key: "learning", text: "Personalized learning recommendations for business growth." },
{ key: "networking", text: "Connections with mentors, founders and startup communities." },
{ key: "opportunity", text: "Structured opportunity pipeline for customers, investors and partners." },
{ key: "strategy", text: "AI-generated Startup Growth Blueprint outlining the next 90 days of execution." },
]),
enterprise: outcomes("enterprise", [
{ key: "intelligence", text: "Measurable Enterprise QX Capability Score." },
{ key: "intelligence-dashboard", text: "Live Workforce Intelligence Dashboard.", requiredKpiKeys: ["intelligence"] },
{ key: "capability", text: "AI-generated competency frameworks and hiring playbooks.", requiredKpiKeys: ["capability", "hiring"] },
{ key: "leadership", text: "Structured leadership and interview standards.", requiredKpiKeys: ["leadership", "hiring"] },
{ key: "learning", text: "Personalized learning pathways for employees." },
{ key: "branding", text: "Enhanced employer branding and visibility." },
{ key: "expert", text: "Access to expert consultations and enterprise events." },
{ key: "strategy", text: "Complete AI-powered Workforce Transformation Blueprint for future-ready talent development." },
]),
};
export function outcomeDefinitionsForIcp(icpId: CuratorIcpId) {
return CURATOR_OUTCOME_REPORT_REGISTRY[icpId] ?? CURATOR_OUTCOME_REPORT_REGISTRY.fresher_early_professional;
}