course-deliverables.mjs 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /** v3 course outputs. Course modules, report categories and stored files are separate counts. */
  2. import { validateReportDelivery } from './report-contract.mjs';
  3. export const COURSE_DELIVERABLES = Object.freeze([
  4. ['D1-01', '品类全景图谱', 'S1', '三栏图谱', ['供给树', '需求树', '供需缺口与来源覆盖']],
  5. ['D1-02', '本题验证配置卡', 'S1', '配置卡与回查记录', ['资料资格', '统计与引文口径', '模型/人工分工与分歧处理', '图谱回查记录']],
  6. ['D1-03', '竞品图谱 + 待验证痛点假设', 'S1', '矩阵与假设清单', ['同格竞品与卖点组合', '宣称/回应/推断', '正反原话与可证伪假设']],
  7. ['D1-04', '增强 AI 自驱任务卡', 'S1', '任务卡', ['稳定假设键', '支持路径与反证路径', '可判定停止条件', '数据来源与权限']],
  8. ['D1-N', '调研战报 + 缺口清单', 'S2', '战报、缺口表与预聚类', ['逐假设回应', '没查到/没权限/确实不存在', '原件覆盖与 VOC 预聚类']],
  9. ['D2-01', '战报验收记录', 'S2', '验收记录与可用资料索引', ['假设回应率', '原件覆盖', '分母口径', '可用资料集合']],
  10. ['D2-02', '聚类表 + 痛点库 + KANO 表 + 人群 × 场景矩阵', 'S2', '四张表', ['四层聚类', '痛点库', 'KANO 频次先验', '人群 × 场景矩阵']],
  11. ['D2-03', '产品机会及指标初表', 'S3', '机会与指标表', ['结构/变化/未覆盖分列', '同格竞品核查', '供给与需求证据', '待验证指标']],
  12. ['D2-04', '候选机会清单 V1.0', 'S3', '清单与六字段机会卡', ['商品事实/用户原声/工艺条件', '结论与反例', '未知与下一步验证', '研发侧工艺注释']],
  13. ['D2-05', '优先级机会清单 + 未知项单列', 'S4', '排序表与未知项表', ['证据强度/可做性/商业价值各 1–3 分', '逐分依据', '任一维 1 分不进前三', '未知不代填低分']],
  14. ['D2-06', '回推表 + 候选机会清单 V2.0', 'S4', '回推表与更新机会卡', ['B0/O1 可比条件', '一次费用/资本投入/营运资金', '成本与目标价格带', '工艺与合规条件']],
  15. ['D2-07', '价值主张卡 + 卖点清单', 'S5', '价值卡与卖点表', ['一句主张与三条收益', '逐句证据', '主推/备选/不能说的话', '证据与合规边界']],
  16. ['D2-08', '概念提案 + 候选清单 V3.0 + 成果导航', 'S5', '三层提案与成果导航', ['一句话/一页/全案', '实际质询与未答问题', 'V3.0 变化理由', '13 份产出物位置与用途']],
  17. ].map(([moduleId, name, stageCode, form, checks]) => Object.freeze({ moduleId, name, stageCode, form, checks: Object.freeze(checks) })));
  18. /** Match only explicit metadata/task identifiers. Never infer a module from a title. */
  19. export function courseModuleOf(artifact) {
  20. const marked = artifact?.report?.delivery?.moduleId;
  21. const known = value => COURSE_DELIVERABLES.some(output => output.moduleId === value);
  22. const task = String(artifact?.reportSeriesKey || '').match(/(?:^|[:/])(D1-(?:0[1-4]|N)|D2-0[1-8])(?=[:/]|$)/)?.[1];
  23. if (marked !== undefined) {
  24. try { validateReportDelivery(artifact.report, artifact.type || artifact.artifactType); }
  25. catch { return ''; }
  26. if (!known(marked) || task && task !== marked) return '';
  27. return marked;
  28. }
  29. return known(task) ? task : '';
  30. }
  31. /** A saved body is a location check; it does not certify research quality or employee approval. */
  32. export function courseOutputLedger(rows, hasContent) {
  33. return COURSE_DELIVERABLES.map(output => {
  34. const reports = rows.filter(row => courseModuleOf(row.artifact) === output.moduleId);
  35. const body = reports.filter(row => Array.isArray(row.artifact.report?.chapters) && row.artifact.report.chapters.some(hasContent));
  36. const submitted = body.filter(row => row.artifact.report?.delivery?.contentStatus !== 'draft');
  37. const state = submitted.length ? 'has-body' : body.length ? 'draft'
  38. : reports.some(row => String(row.artifact.rawText || '').trim()) ? 'text-only'
  39. : reports.length ? 'missing-body' : 'missing';
  40. return { ...output, state, reports };
  41. });
  42. }