$npx -y skills add QFIN-tech/model-evo --skill uplift-model-reporting已有 task_config_path、subject_result_paths 和可选 supporting_paths 后,用于从上游结构化结果生成最终 Uplift 建模报告、HTML、facts 和 manifest。不要用于重算指标、训练、调参、比较排序或模型采用执行。
| 1 | # Uplift 最终报告 |
| 2 | |
| 3 | ## 1. 输入依赖 |
| 4 | |
| 5 | 本 skill 只基于显式 path 聚合上游事实,生成面向业务用户的最终建模报告: |
| 6 | |
| 7 | - `report_facts.v1.json` |
| 8 | - `report_manifest.v1.json` |
| 9 | - Markdown 报告 |
| 10 | - HTML 报告 |
| 11 | - flow root `report.md` |
| 12 | |
| 13 | 已有 `task_config_path`、`subject_result_paths` 和可选 `supporting_paths` 后使用。 |
| 14 | |
| 15 | 候选模型来源支持: |
| 16 | |
| 17 | - `uplift-model-s-learner-modeling` |
| 18 | - `uplift-model-t-learner-modeling` |
| 19 | - `uplift-model-tuning` 产出的 S-Learner tuning result |
| 20 | - `uplift-model-tuning` 产出的 T-Learner tuning result |
| 21 | |
| 22 | 展示名至少包括 `S-Learner Baseline`、`S-Learner Tuned`、`T-Learner Baseline`、`T-Learner Tuned`。T-Learner 的 `feature_importance.v1.csv` 如果包含 `component` 字段,报告按 component 分段展示 top features。 |
| 23 | |
| 24 | ## 2. 执行入口 |
| 25 | |
| 26 | 统一 CLI: |
| 27 | |
| 28 | ```bash |
| 29 | python <skill-dir>/scripts/run.py --input - --output-dir <output_dir> |
| 30 | ``` |
| 31 | |
| 32 | Windows 环境可按需将路径分隔符改为反斜杠。 |
| 33 | |
| 34 | `--output-dir` 必须是已存在的 `run_dir`;runner 不创建 run_dir,不扫描 `latest/current`。本 skill 输出到: |
| 35 | |
| 36 | ```text |
| 37 | {run_dir}/uplift-model-reporting/{timestamp}_uplift_reporting/ |
| 38 | inputs/0001_generate_report.request.json |
| 39 | results/0001_generate_report.result.json |
| 40 | artifacts/ |
| 41 | _flow_manifest.json |
| 42 | _flow_log.jsonl |
| 43 | report.md |
| 44 | ``` |
| 45 | |
| 46 | 所有 stdout、result、manifest 和 log 中的持久化 path 都是 `run_dir` 相对路径。输入只通过显式 `task_config_path`、`subject_result_paths`、`supporting_paths` 接力,不读取 latest/current,也不回填 `{run_dir}/report.md`。 |
| 47 | |
| 48 | 请求 JSON 必须通过 stdin 传入: |
| 49 | |
| 50 | ```json |
| 51 | {"action": "generate_report", "payload": {"task_config_path": "...", "subject_result_paths": ["..."], "supporting_paths": {"comparison_result_path": "..."}}} |
| 52 | ``` |
| 53 | |
| 54 | runner stdout 是 JSON object。调用方只读取 stdout 或 result JSON 中的 `outputs.*` 字段,例如 `outputs.final_report_path`、`outputs.markdown_report_path`、`outputs.html_report_path`、`outputs.report_path`。 |
| 55 | |
| 56 | 只接受显式 `*_path` / `*_paths` 字段。收到旧的 `*_ref` / `*_refs` 输入时,runner 返回 `needs_input`,并在 `issues` 与 `next_steps` 中给出对应替代字段。 |
| 57 | |
| 58 | ## 3. Actions 与参数说明 |
| 59 | |
| 60 | `generate_report` |
| 61 | |
| 62 | - 输入:`task_config_path`、`subject_result_paths`。 |
| 63 | - 可选输入:`supporting_paths`、`report_decision`、`recommended_candidate_result_path`。 |
| 64 | - 输出: |
| 65 | - `final_report_path` |
| 66 | - `report_facts_path` |
| 67 | - `report_manifest_path` |
| 68 | - `markdown_report_path` |
| 69 | - `html_report_path` |
| 70 | - `report_path` |
| 71 | |
| 72 | `supporting_paths` 可包含: |
| 73 | |
| 74 | - `sample_preparation_result_path` |
| 75 | - `sample_homogeneity_result_path` |
| 76 | - `feature_quality_result_path` |
| 77 | - `comparison_result_path` |
| 78 | - `candidate_result_paths` |
| 79 | - `modeling_sample_spec_path` |
| 80 | - `feature_plan_path` |
| 81 | |
| 82 | 生成完整最终报告时,应显式传入 `sample_preparation_result_path`、`sample_homogeneity_result_path`、`feature_quality_result_path` 和 `comparison_result_path`;缺少任一项时,报告仍可生成,但会返回 `partial_success` 并在缺失证据中标记对应章节。 |
| 83 | |
| 84 | 如果 comparison 产生推荐候选,调用方应显式传入 `report_decision`,例如: |
| 85 | |
| 86 | ```json |
| 87 | {"adoption": "adopt_recommended", "decision_maker": "user"} |
| 88 | ``` |
| 89 | |
| 90 | ## 4. 输出产物 |
| 91 | |
| 92 | 典型输出目录: |
| 93 | |
| 94 | ```text |
| 95 | {run_dir}/uplift-model-reporting/{timestamp}_uplift_reporting/ |
| 96 | inputs/ |
| 97 | results/ |
| 98 | artifacts/ |
| 99 | report_facts.v1.json |
| 100 | report_manifest.v1.json |
| 101 | uplift-report.v1.md |
| 102 | uplift-report.v1.html |
| 103 | _flow_manifest.json |
| 104 | _flow_log.jsonl |
| 105 | report.md |
| 106 | ``` |
| 107 | |
| 108 | 报告保持面向业务用户的最终建模报告形态,包含:执行摘要、任务定义、样本质量、同质性、特征质量、候选模型、模型比较、采用决策、风险与限制、建议下一步、追踪摘要。 |
| 109 | |
| 110 | ## 5. 与其他 skill 的关联 |
| 111 | |
| 112 | | 方向 | Skill | 关系 | |
| 113 | |---|---|---| |
| 114 | | 上游 | `uplift-model-result-comparison` | 可提供 `model_comparison_summary_path`、`recommended_candidate_result_path` 和采用决策证据 | |
| 115 | | 上游 | `uplift-model-s-learner-modeling` / `uplift-model-t-learner-modeling` / `uplift-model-tuning` | 提供 `subject_result_paths` 中的候选模型结果 | |
| 116 | | 下游 | 无 | 作为最终报告产出,不触发后续 skill | |
| 117 | |
| 118 | ## 6. 执行约束 |
| 119 | |
| 120 | 本 skill 不重算样本、同质性、特征、模型、调参或比较指标,不训练模型,不创建模型采用状态。 |
| 121 | |
| 122 | 输入只通过显式 `task_config_path`、`subject_result_paths`、`supporting_paths` 接力,不读取 latest/current,也不回填 `{run_dir}/report.md`。 |
| 123 | |
| 124 | 如果 comparison 产生推荐候选,调用方应显式传入 `report_decision`,例如 `{"adoption": "adopt_recommended", "decision_maker": "user"}`。 |
| 125 | |
| 126 | ## 7. 异常处理 |
| 127 | |
| 128 | ### 7.1 字段兼容异常 |
| 129 | |
| 130 | 只接受显式 `*_path` / `*_paths` 字段。收到旧的 `*_ref` / `*_refs` 输入时,runner 返回 `needs_input`,并在 `issues` 与 `next_steps` 中给出对应替代字段。 |
| 131 | |
| 132 | ### 7.2 证据缺失处理 |
| 133 | |
| 134 | 报告应基于显式 path 聚合上游事实;缺少可选证据时在报告中表达缺失证据和主要风险,不重算或补造上游指标。 |
| 135 | |
| 136 | ## 8. 面向用户回复 |
| 137 | |
| 138 | 普通用户回复默认使用中文。先给报告是否生成、采用表达、缺失证据和主要风险,再提供 Markdown 报告路径。不要把 raw JSON、内部目录结构、长路径清单或实现术语作为主回复内容。 |
| 139 | |
| 140 | 除非用户明确要求查看 JSON、调试、获取产物路径或手动接力下游流程,否则不要在用户回复中展示工程中的 `.json` 文件路径;`report_facts`、`report_manifest` 等 JSON 路径只作为内部/审计输入传递。Markdown/HTML 报告是面向人阅读的产物,可以按需给出。 |
| 141 | |
| 142 | 确需精确交接时,可在“技术详情”里保留 `final_report_path`、`markdown_report_path`、`html_report_path`、`report_path` 等字段名,并说明用途。 |