187 Commits

Author SHA1 Message Date
hub-gif
6f04326400 fix(frontend): track multiple in-flight generation keys (regen vs preview)
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
4847003a05 fix(frontend): keep regen in-flight lock on client disconnect (tab switch)
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
fdf5901f76 fix(frontend): persist generation in-flight key in sessionStorage (HMR/reload)
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
a1b02e3ed7 chore(django): fail fast with hint when pipeline 0012/0013 migration files missing
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
34fe9079ee chore(migrations): add 0013 rebuild checkpoint table (was untracked)
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
cd863864a0 fix(frontend): disable report regen while any job regen is in flight
Made-with: Cursor
2026-04-14 17:12:03 +08:00
hub-gif
134faffbe8 feat: default LLM for report regen, job report_config, and API defaults
Made-with: Cursor
2026-04-14 13:28:18 +08:00
hub-gif
48ed337310 refactor(frontend): simplify report build page, drop LLM checkboxes
Made-with: Cursor
2026-04-14 13:25:51 +08:00
hub-gif
f3fe8cd5fd fix(pipeline): restore LLM report regenerate (views b675903); extend report_config keys
Made-with: Cursor
2026-04-14 13:22:42 +08:00
hub-gif
c45ec66d4c feat(report): remove §5 competitor matrix table, keep per-group charts
Made-with: Cursor
2026-04-14 13:18:40 +08:00
hub-gif
a1d0fa6686 fix(report): shop/brand pie totals, matrix price charts, drop LLM §8.5 merge
Made-with: Cursor
2026-04-14 13:16:29 +08:00
hub-gif
2548ba1df5 fix(pipeline): align models and serializers with pause/resume checkpoint
Made-with: Cursor
2026-04-14 13:11:21 +08:00
hub-gif
b6759039c8 fix(llm): tier compact brief for §8.5 to fit 32k context window
Regenerate-report §8.5 payload exceeded ~32k ctx; try decreasing
compact_brief_for_llm max_chars then truncate JSON with notice.

Made-with: Cursor
2026-04-14 11:36:28 +08:00
hub-gif
4be389bf8d fix(api): return 400 for LLM config ValueError on regenerate-report
503 was misleading for missing OPENAI_API_KEY/LLM_BASE_URL and prompt-too-large;
log warning with job id. Keep 503 for unexpected ValueError.

Made-with: Cursor
2026-04-14 11:26:56 +08:00
hub-gif
1f6abe49ee feat(pipeline): wire matrix/price/comment group LLM into report body
- build_matrix/price_groups_llm_payload from merged rows
- jd_runner: call generate_*_group_summaries_llm when report_config or
  MA_ENABLE_LLM_*; write matrix/price/comment_groups_llm.json sidecars
- build_competitor_markdown: insert §5.1, §6.2, §8.6 with disclaimers
- §1.3 note for optional llm_*_group_summaries flags

Made-with: Cursor
2026-04-14 11:15:17 +08:00
hub-gif
15ba8b3370 fix(llm): restore matrix/comment/price group advisor prompts and callers
Re-add MATRIX/COMMENT/PRICE_GROUPS_SYSTEM and generate_*_group_summaries_llm
removed in afe2748; align comment-group prompt with shop in attribution
prefix. Default report_config now includes the three llm_*_summaries flags.

Made-with: Cursor
2026-04-14 11:08:24 +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
afe2748129 fix(llm): drop unused group-summary helpers reintroduced by patch
Keep only REPORT_SYSTEM / SENTIMENT prompt tightening; remove dead
matrix/comment/price LLM helpers not referenced by views or jd_runner.

Made-with: Cursor
2026-04-14 10:57:13 +08:00
hub-gif
efd8aa7cfc fix(llm): require aggregate-only complaints in §8.5 without fake quotes
§8.5 brief lacks per-SKU review text; tighten REPORT_SYSTEM so lexicon
hits are described as cross-SKU substring stats and forbid quoted
fabricated examples. Align sentiment helper: no quoted specifics absent
from samples.

Made-with: Cursor
2026-04-14 10:55:12 +08:00
hub-gif
708f28f40e fix(report): restore jd_competitor_report after mistaken chart revert
9cc8de9 accidentally rewrote jd_competitor_report.py and merged an oversized
report_charts.py. Reset both to f19d112 baseline; keep only obsolete cleanup
for removed global bar chart filenames.

Made-with: Cursor
2026-04-14 10:51:38 +08:00
hub-gif
9cc8de9006 revert(report): drop global focus/scenario bar charts
Remove chart_comment_focus_global_bar / chart_usage_scenarios_global_bar
generation and markdown embed; delete leftovers on chart regen.

Made-with: Cursor
2026-04-14 10:48:54 +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
e2a0a442a7 fix(pipeline): scenario LLM merge without unrelated runner/vue churn
Restore jd_runner/JdAnalysisView to prior behavior except schema_version 3,
scenario suggest block, and default comment_scenario_groups fallback when
eff_rc omits them. Reverts accidental WIP bundled in previous commit.

Made-with: Cursor
2026-04-14 10:38:00 +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
be0215bfe2 fix(ai_crawler): cap max_tokens to remaining context window
LiteLLM rejects when max_tokens exceeds context minus measured input
tokens. Estimate input from prompt length and clamp max_tokens; allow
LLM_CONTEXT_WINDOW override. Prevents ContextWindowExceededError on long
Chinese/JSON prompts (e.g. regenerate-report §8.5).

Made-with: Cursor
2026-04-14 10:16:38 +08:00
hub-gif
9797796f2e fix(pipeline): cap LLM brief size on report regen; enrich chat HTTP errors
Regenerate-report (llm) used compact_brief_for_llm default 350k chars,
unlike other LLM steps (80k–100k), which can cause gateway timeouts or 5xx
surfacing as 502. chat_completion_text now attaches response body snippet
to HTTPError for easier diagnosis.

Made-with: Cursor
2026-04-14 09:55:42 +08:00
hub-gif
a8210ec933 feat(报告): 各章大模型衔接分析与 report_config 开关
Made-with: Cursor
2026-04-13 11:06:35 +08:00
hub-gif
b7d932b920 feat(报告): 第六章增加优惠活动与标价券后价差分析
Made-with: Cursor
2026-04-13 10:59:22 +08:00
hub-gif
ed2738953f refactor(报告): 全文大模型补充改为嵌入第八章末而非篇首
Made-with: Cursor
2026-04-13 10:54:43 +08:00
hub-gif
bac71c00be feat(报告): 评价大模型解读强化负向主题归因与抽样
Made-with: Cursor
2026-04-13 10:52:14 +08:00
hub-gif
c76efd80e5 chore(backend): 将 Playwright 加入依赖以支持京东流水线
Made-with: Cursor
2026-04-13 10:42:07 +08:00
hub-gif
7fc59e5c5f fix(pipeline): 报告重生成时路径与数据错误统一返回 400
Made-with: Cursor
2026-04-13 10:36:25 +08:00
hub-gif
2eacf4b306 chore(gitignore): 将日报目录排除在版本库之外
Made-with: Cursor
2026-04-13 09:46:29 +08:00
hub-gif
eceecbffbf docs: merge deployment into README, remove DEPLOY_AND_GIT.md
Made-with: Cursor
2026-04-10 18:19:27 +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