33 Commits

Author SHA1 Message Date
hub-gif
f09a46a79e feat(pipeline): 策略表单增加营销与总体策略并顺延规则稿章节
- API:marketing_strategy、general_strategy;规则骨架新增「二、营销策略与总体方向」,原 §2–§9 顺延为 §3–§10。
- LLM 提示与探针说明用语同步;OpenAPI、单测与策略生成页字段集「五」已对齐。

Made-with: Cursor
2026-04-17 17:08:25 +08:00
hub-gif
16d64565a3 feat(pipeline): 策略骨架缩短并强化策略生成决策边界
- 规则稿:章节重排为短骨架,去重复假设套话;探针模式三条占位,传统模式改为统计摘录句式。
- LLM:STRATEGY_SYSTEM 明确表单已定项不可反写,空项由数据补全,成稿禁止二次决策话术。
- API/前端:新增目标客群、主要对标、资源备注字段并传入 strategy_decisions。
- OpenAPI 与单测同步。

Made-with: Cursor
2026-04-17 17:04:24 +08:00
hub-gif
932c3d6aeb fix(strategy): 文本挖掘开启时策略稿不再依赖关注词/场景计数
报告配置 chapter8_text_mining_probe 为 True(默认)时,规则底稿第五节改为说明口径并去掉子串命中列表;LLM 请求从 structured_brief 剔除相关字段并附 omission_note。关闭探针时保留旧版第五节。任务 API 传入 report_config。

Made-with: Cursor
2026-04-17 16:56:08 +08:00
hub-gif
1229e49dbe refactor(frontend): 策略生成默认大模型,仅保留「本次规则稿」选项
移除「使用大模型」与保存策略偏好;buildPayload 默认 generator=llm;勾选本次仅规则稿时走 rules。后端默认 use_llm_default 改为 true。

Made-with: Cursor
2026-04-17 16:44:15 +08:00
hub-gif
7d219feb3c feat(pipeline): 策略页独立 strategy_config 与仅规则稿选项
新增 PipelineJob.strategy_config(默认 use_llm_default);GET /api/strategy-config-defaults/;PATCH 任务可保存策略偏好。策略生成页:本次仅规则稿复选框(默认关)、保存策略偏好、任务下拉去掉目录;第九章对齐仍由服务端默认处理。迁移 0021。

Made-with: Cursor
2026-04-17 16:41:20 +08:00
hub-gif
6e113bbdfe feat(pipeline): S1 策略稿与第九章对齐(report_strategy_excerpt)
新增 load_report_strategy_excerpt:优先 strategy_opportunities_llm.json 的 markdown,否则从 competitor_analysis.md 截取第九章;runner 成功时落盘 markdown 字段。STRATEGY_SYSTEM 收紧与 report_strategy_excerpt 一致及业务冲突标注。策略稿 API 返回节选来源与字符数;补充单测与 OpenAPI、规划文档。

Made-with: Cursor
2026-04-17 16:26:00 +08:00
hub-gif
6a308179ad test(pipeline): 在 tests/conftest 中 django.setup 以修复收集阶段 AppRegistryNotReady
pytest 收集含 pipeline.jd.runner 的测试时须先加载 Django;全量 pipeline/tests 现可一次跑通。

Made-with: Cursor
2026-04-17 14:56:35 +08:00
hub-gif
e4a05f3ce6 refactor(pipeline): 移除 csv_schema 等根目录中转,统一从 pipeline.csv 子包导入
- 删除 csv_schema.py、csv_header_rewrite.py、matrix_group_label.py(无引用)

- 全库改为 from pipeline.csv.schema / pipeline.csv.header_rewrite;文档字符串同步

- 与此前 jd_competitor_report 去中转同一策略

Made-with: Cursor
2026-04-17 14:48:32 +08:00
hub-gif
0e224c6a6c refactor(pipeline): 移除 jd_competitor_report 中转,统一导入 competitor_report.jd_report
- 删除 backend/pipeline/jd_competitor_report.py;runner/测试与演示改为 from pipeline.competitor_report import jd_report

- 爬虫目录 jd_competitor_report.py 仅调用 jd_report.main;文档与 OpenAPI 同步更新

- 命令行推荐:python -m pipeline.competitor_report.jd_report

Made-with: Cursor
2026-04-17 14:46:21 +08:00
hub-gif
0d8e1962d7 refactor: 竞品报告迁入 pipeline,爬虫目录仅保留采集与兼容入口
competitor_report 子包与 jd_competitor_report 主模块移至 backend/pipeline;runner 与测试改为 from pipeline import jd_competitor_report;crawler_copy 下 jd_competitor_report 为转发 shim;jd_keyword_pipeline 文档更新。

Made-with: Cursor
2026-04-17 13:47:34 +08:00
hub-gif
2a27a611ca refactor(pipeline): 拆分 llm/generate 为网关与各场景子模块
- 新增 llm_client(路径与 chat 调用、token/上下文估算)。

- 按职责分为 generate_competitor_full、generate_sections、generate_strategy、generate_group_summaries。

- generate.py 保留聚合导出与 _call_llm 别名;测试 patch 路径改为指向子模块。

- 同步导出 _join_chunked_group_markdown。

Made-with: Cursor
2026-04-17 11:24:43 +08:00
hub-gif
0e353318e1 feat(report): §8.2 先按评分分桶再统计口语短语
Made-with: Cursor
2026-04-16 14:57:58 +08:00
hub-gif
b10d282980 test(pipeline): 单细类评论要点归纳 LLM 烟测(mock 网关)
构造仅「饼干」矩阵细类的 build_comment_groups_llm_payload,断言 generate_comment_group_summaries_llm 与 chunked 单组时各调用一次网关,且 user JSON 含 keyword 与 group。

Made-with: Cursor
2026-04-16 10:52:04 +08:00
hub-gif
0be4049860 docs(copy): 将「口径」改为计数规则、说明、价格来源等通俗表述
报告正文、简报、策略草稿、API 说明与 LLM 提示中避免「统计口径」等行话;列表 CSV 表头「销量口径」改为「销量展示」;日报目录未改。

Made-with: Cursor
2026-04-16 10:43:44 +08:00
hub-gif
a2523415d5 docs(copy): 用「归类」替换易误解的「桶」表述
报告说明、docstring 与情感分析 LLM 提示中的「分桶/乱桶」等改为归类、关键词规则等通俗说法;JSON 字段名 sentiment_bucket_method 未改。

Made-with: Cursor
2026-04-16 10:40:39 +08:00
hub-gif
99d1b23b63 feat(pipeline): 按矩阵细类拆分 group 归纳 LLM 请求
§5/§6/§8 等 payload 仍含全部细类,但默认对每个细类单独调用网关并拼接 Markdown,降低单次上下文并减少跨类干扰。report_config.llm_group_summaries_chunk_by_matrix 可关闭;环境变量 MA_LLM_GROUP_SUMMARIES_BULK=1 恢复单次打包调用。

Made-with: Cursor
2026-04-16 10:34:29 +08:00
hub-gif
a43e1f9b1d feat(dataset): 搜索/宽表支持按解析后销量与评价量排序
新增 sales_sort_value、comment_count_sort_value 与 volume_parse;入库与迁移回填;sort=total_sales|comment_count;前端排序下拉文案。

Made-with: Cursor
2026-04-16 10:15:24 +08:00
hub-gif
9cea35a665 fix(report): drop §4 brand/shop tables, align CR with pie charts
Remove duplicate Markdown tables under 4.1/4.2; compute CR from strip-normalized names matching list_*_mix_top pies. Smaller figsize for list brand/shop pies; default pie slightly compact. Deduplicate test_mix_top_remainder test; assert _structure_names_for_pie_counter length.

Made-with: Cursor
2026-04-15 17:54:53 +08:00
hub-gif
6280e436d8 feat(pipeline): JD 流水线 CSV 纯中文表头与模块目录重构
- 统一 csv_schema 与搜索/合并/评价/商详导出为纯中文列名,入库与视图按中文表头解析

- 竞品分析报告兼容新旧表头;新增 csv_header_rewrite 与 rewrite_pipeline_csv_headers 管理命令

- 调整 pipeline 至 jd、llm、reporting、demos 子包并更新任务与测试引用

- 新增购买者优惠摘要抽取、合并表 regen/ingest 命令、0016 迁移及相关测试

Made-with: Cursor
2026-04-15 16:02:29 +08:00
hub-gif
5cafa75ab7 feat(pipeline): 新增 Markdown 文档导出、单测与价格分组 LLM 演示脚本
补充 md_document_export 的 DOCX/PDF 导出能力及回归测试,并加入 run_price_groups_llm_demo 便于本地演示。

Made-with: Cursor
2026-04-15 09:32:32 +08:00
hub-gif
43b72cb32e feat: 关注词与场景延伸、报告体验与导出修复
- 流水线:评价关注词与使用场景的大模型延伸(jd_runner、竞品报告、测试)

- 界面:报告生成与查看的通俗化文案;策略稿集中度按店铺/品牌区分

- 导出:PDF 插图限制最大尺寸避免 LayoutError;报告 Word/PDF 改为 blob 下载;策略稿导出错误解析;PDF 补充 Linux 中文字体路径

Made-with: Cursor
2026-04-14 18:23:25 +08:00
hub-gif
c3fdb2b970 fix(report): align shop/brand pie denominators with §4 CR table via mix tail bucket
Made-with: Cursor
2026-04-14 17:28:52 +08:00
hub-gif
36aa36c60b refactor(pipeline): inline total_sales fallback; remove temp backfill script; add refresh command
Made-with: Cursor
2026-04-14 17:28:52 +08:00
hub-gif
b4e97a4c34 feat(pipeline): backfill totalSales column from pc_search_raw without re-crawl
Made-with: Cursor
2026-04-14 17:28:52 +08:00
hub-gif
8611e78a26 feat(jd-pipeline): matrix chart and brief use totalSales for sales volume
Made-with: Cursor
2026-04-14 17:28:17 +08:00
hub-gif
c6560bd12b fix(report): use detail_category_path only for matrix and fine-category stats
Made-with: Cursor
2026-04-14 17:25:54 +08:00
hub-gif
6a9b6af321 test(pipeline): restore llm_keyword_suggest parse unit tests
Made-with: Cursor
2026-04-14 17:12:31 +08:00
hub-gif
dd5fa8a407 feat(comments): attribute sentiment LLM samples to shop and SKU
- Add _comment_lines_with_product_context and build_comment_groups_llm_payload
- build_comment_sentiment_llm_payload: lexicon on plain text, samples with
  【细类|SKU|品名|店铺】 prefix; jd_runner passes parallel attributed lines
- Tighten §8.2/§8.5 prompts so negatives tie to shop + product; tests assert 店铺

Made-with: Cursor
2026-04-14 11:04:35 +08:00
hub-gif
f19d112e73 test(pipeline): print live LLM JSON to stderr in keyword/scenario tests
Made-with: Cursor
2026-04-14 10:44:47 +08:00
hub-gif
e708480382 test(pipeline): fix scenario parse fenced case (min trigger length 2)
Made-with: Cursor
2026-04-14 10:40:42 +08:00
hub-gif
1deea3af35 feat(pipeline): LLM-extend usage scenario groups from comments
Add suggest_scenario_groups_llm: single call with excerpt corpus + existing
label/triggers, parse scenarios JSON, merge into comment_scenario_groups
(up to 40) before build_competitor_brief. Record in keyword_suggest_llm.json
(schema_version 3). Skip with MA_SKIP_LLM_SCENARIO_SUGGEST. Update tests
and analysis view hint.

Made-with: Cursor
2026-04-14 10:36:28 +08:00
hub-gif
bca19fd845 test(pipeline): run llm_keyword_suggest against real LLM when keys set
Remove mock; load market_assistant/.env before checking credentials.
Live test skips without OPENAI_* or LLM_* key+base URL.

Made-with: Cursor
2026-04-14 10:26:55 +08:00
hub-gif
d8086dfdd5 Initial commit: Market-Assistant standalone (Django + Vue + JD crawler copy)
Made-with: Cursor
2026-04-10 18:03:35 +08:00