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