446 Commits

Author SHA1 Message Date
mumu
3153c764a4 fix: 收敛多股通知摘要的市场状态展示 (#1612)
* fix: compact aggregate report market status

* fix(review-feedback-1612): preserve input order when selecting market status

* chore: rerun review after clarifying PR scope
2026-06-05 22:47:39 +08:00
fzxiong
39f24df60b 代码健康修复:稳定测试、健康检查、错误响应与 schema 版本记录 (#1607)
* fix(api): return json from root health endpoint

* test(web): stabilize vitest runtime setup

* chore(security): warn on public web exposure without auth

* refactor(api): centralize error response helpers

* chore(db): record baseline schema version

* refactor(web): extract portfolio formatting helpers

* fix(db): make schema baseline initialization idempotent

* docs: document health check and schema baseline changes
2026-06-05 21:26:06 +08:00
Delicious233
3471afbd98 feat: add Feishu App Bot notification sender with P2P and group support (#1553)
* feat: add Feishu App Bot notification sender with P2P and group support

The existing FeishuSender only supports custom robot Webhook mode.
This commit extends it to support App Bot (lark-oapi SDK) mode, auto-routing
between webhook (priority) and App Bot when FEISHU_APP_ID + FEISHU_APP_SECRET
+ FEISHU_CHAT_ID are configured.

Design:
- send_to_feishu() routes: webhook if URL set, else App Bot
- DCLP lazy client init with thread-safe sentinel guard
- Retry (3 attempts, exponential backoff) with fixed UUID for idempotency
- Card-first / text-fallback content strategy
- Chunking for long messages
- Runtime enum validation for FEISHU_RECEIVE_ID_TYPE and FEISHU_DOMAIN
- Safe SDK defaults (FEISHU_DOMAIN/LARK_DOMAIN) before import try-block
  so Webhook path never depends on lark-oapi SDK presence
- Config, diagnostics, setup check, notification test, and CI workflow
  all consistent with the new App Bot channel semantics
- lark-oapi>=1.0.0 already in requirements.txt (line 23)

Verification:
- 20/20 unit tests pass (help metadata + FeishuSender)
- E2E: real Feishu API — SDK import, token, client init, P2P text+card send all PASS
- Webhook regression: verified no SDK dependency for existing Webhook path

* fix: add missing Feishu App Bot locale entries and env table keys, harden sender error handling

CI fix 1 (test_registry_help_keys_exist_in_locales):
- Add zh-CN and en-US locale entries for FEISHU_CHAT_ID,
  FEISHU_RECEIVE_ID_TYPE, FEISHU_DOMAIN in settingsHelp.ts

CI fix 2 (test_notification_actions_env_table_matches_generated_output):
- Add FEISHU_RECEIVE_ID_TYPE, FEISHU_DOMAIN to feishu advanced_keys
  in CHANNEL_SPECS so they appear in KEY_SPECS
- Regenerate managed env table in docs/notifications.md

feishu_sender.py hardening:
- Catch network exceptions in webhook _post_payload so card-to-text
  fallback actually executes on transient failures
- Guard response.json() and isinstance(result, dict) against
  non-JSON / non-dict HTTP 200 responses
- Extract shared _build_card_body() to de-duplicate card payload
  construction between webhook and App Bot paths
- Rename module-level lark -> _lark to avoid shadowing
- Guard resp.get_log_id() with try/except
- Add None guard on send_to_feishu content parameter

e2e script improvements:
- Support FEISHU_OPEN_ID for P2P test, FEISHU_DOMAIN for Lark
- Add FEISHU_TEST_SEND_TEXT=1 for plain-text-only path testing
- Clarify docstring: setup validation + smoke test, not full e2e

* fix: consolidate Feishu App Bot notification contract

* fix: align Feishu domain help scope

---------

Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-06-05 08:56:42 +08:00
mumu
0ca4e07b0e feat: integrate AlphaSift with DSA runtime enrichment (#1577)
* feat: integrate AlphaSift with DSA runtime enrichment

* feat: pin AlphaSift DSA provider context

* fix: clean up AlphaSift warning display

* fix(review-feedback-1577): pass the headers through a path AlphaSift actually uses, such as a

* fix(review-feedback-1577): 补齐 LLM 运行时桥接兼容性的关键证据

* fix: keep AlphaSift screening lightweight

* fix(review-feedback-1577): Populate DSA news when reusing context

* fix(review-feedback-1577): 补齐外部 LLM/LiteLLM 兼容依据,并修正 docs/CHANGELOG.md 的格式/重复条目问题

* fix(review-feedback-1577): 补齐外部模型/API 兼容依据或在 PR 正文中明确指向已更新文档中的官方来源与迁移/回退边界

* fix(review-feedback-1577): scripts/build-backend.ps1 已随本 PR 调整 AlphaSift 打包/收集逻辑,但完整改动文件列表未包含

* fix(review-feedback-1577): 处理 AlphaSift LLM bridge 对全局 LiteLLM 状态的并发污染风险

* fix: reuse DSA daily history for AlphaSift

* fix(review-feedback-1577): 补齐 --collect-all alphasift 或等价 hidden imports,并增加打包产物级导入验证

* fix(review-feedback-1577): fix the macOS AlphaSift package verifier

* fix(review-feedback-1577): scripts/build-backend-macos.sh 和 scripts/build-backend.ps1

* fix(review-feedback-1577): 处理运行时阻塞风险、CHANGELOG 删除既有条目,以及补齐外部模型/API 兼容证据

* fix(review-feedback-1577): scripts/build-backend-macos.sh:当前“Verifying packaged AlphaSift

* fix(review-feedback-1577): 收敛下面的可用性判断和外部 API/模型兼容证据缺口

* fix(review-feedback-1577): src/config.py、src/core/config registry.py、src/services/alphasift

* fix(review-feedback-1577): scripts/build-backend-macos.sh:新增的 packaged AlphaSift importability

* fix(review-feedback-1577): make the archive fallback require a dsa adapter entry or exercise the

* fix(review-feedback-1577): 处理无关测试改动,并补齐桌面打包文档/验证边界
2026-06-05 08:53:55 +08:00
Alfred
71055c449c fix: 问股自由文本金融缩写不再误识别为股票代码 (#1604)
* fix: prevent finance abbreviations from becoming chat tickers

* fix: filter uppercase filler words in chat ticker extraction
2026-06-05 08:51:12 +08:00
mumu
8df69fe036 feat: 完善大盘复盘历史聚合、查看与删除能力 (#1580) (#1598)
* feat(issue-1580): feat:-完善大盘复盘历史聚合、查看与删除能力

* fix(review-feedback-1598): resetting the paged window or deduping the merged list before storing it

* fix(review-feedback-1598): 补齐 AGENTS.md 要求的用户可见能力文档同步
2026-06-04 22:29:20 +08:00
mumu
d6234cd7f0 fix: clarify Docker env runtime config (#1586)
* fix: clarify Docker env runtime config

* fix(review-feedback-1586): 确认并修复启动环境变量兜底对 switch 类型配置的展示正确性,否则 Docker 用户仍可能在关键布尔配置上看到错误状态

* fix(review-feedback-1586): 修正 docs/CHANGELOG.md 的范围漂移和重复内容

* fix(review-feedback-1586): 补充说明这些值仅作为已有配置键的展示 fallback,不新增默认 provider/model/Base URL,也不会静默迁移或清空用户配置

* fix(review-feedback-1586): 确认并修复运行时注入的 LLM channel 支持键在 Settings 保存/校验路径中的一致性问题

* fix(review-feedback-1586): 修复下述运行时配置静默持久化风险

* fix(review-feedback-1586): 修复 runtime-only LLM support key 过滤逻辑对“同一 channel 部分字段来自

* fix(review-feedback-1586): apps/dsa-web/src/components/settings/LLMChannelEditor.tsx、src/services/s

* fix(review-feedback-1586): Avoid migrating runtime-only secrets on rename

* fix(review-feedback-1586): 补充该说明

* fix(review-feedback-1586): docs/CHANGELOG.md 新增说明直接引用 litellm =1.80.10,!=1.82.7,!=1.82.8,<2.0.0

* fix(review-feedback-1586): 补齐“持久化 API KEY + runtime-only API KEYS

* fix(review-feedback-1586): 收敛
2026-06-04 19:17:36 +08:00
mumu
b612fb23e4 fix: 结构化大盘复盘报告展示 (#1576)
* feat: add dedicated market review report view

* fix(review-feedback-1576): Use localized labels for English market reviews

* fix: structure market review payload rendering

* fix(review-feedback-1576): preserve market labels when rendering combined reviews and Use the

* fix(review-feedback-1576): Render structured data for every combined market and Localize

* fix: dedupe market review rendering

* test: align market review language prompt expectation

* fix(review-feedback-1576): 澄清并补足 LLM/运行时配置相关检测命中的兼容性证据

* fix(review-feedback-1576): 解决冲突并重新确认 CI

* fix(review-feedback-1576): docs/CHANGELOG.md:[Unreleased] 新增内容中除 1555 大盘复盘展示外,还包含 Agent

* fix(review-feedback-1576): 修复

* fix(review-feedback-1576): 修复美股中文大盘复盘仍混入英文策略/市场标签的问题,并补齐对应回归测试
2026-06-04 13:40:42 +08:00
Alfred
3281d96788 docs: close analysis context pack P6 (#1592) 2026-06-04 12:37:48 +08:00
Alfred
9b76f8d240 feat: #1386 P6 联动告警、持仓和历史阶段摘要 (#1589)
* feat: link phase summaries across P6 surfaces

* fix: align portfolio analysis response status

* fix: stabilize backtest phase filtering

* fix: normalize portfolio analysis symbols
2026-06-04 09:17:39 +08:00
mumu
14d666bccd fix: avoid agent daily bars missing false positive (#1578) 2026-06-03 21:30:07 +08:00
Octopus
52558a9c31 feat: upgrade MiniMax default model to M3 (#1574)
* feat: upgrade MiniMax default model to M3

- Add MiniMax-M3 to model list and set as default
- Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed
- Remove older models (M2.5)
- Update related tests

* docs: clarify MiniMax-M3 conservative <=512K pricing tier and restore M2.5 legacy entry

Address review feedback on MiniMax model upgrade:

- M3 official docs report up to 1M input tokens with a separate >512K input
  pricing tier; expand inline comments in src/agent/llm_adapter.py and in
  docs to make clear that this PR conservatively registers only the
  <=512K input bucket (context_window=512000, max_tokens=128000,
  $0.6/M input, $2.4/M output), and that long-context cost estimates
  using this entry should be treated as a floor.
- Restore MiniMax-M2.5 as a legacy entry under _CUSTOM_MODEL_PRICING so
  existing user configs that still reference M2.5 continue to report
  accurate cost estimates instead of silently falling back to the zero-
  cost generic pricing. M2.5 is still listed as a Legacy Model on the
  official pricing page; the comment block notes the removal precondition.
- Update docs/CHANGELOG.md and docs/llm-providers.md to mention the 1M
  upstream limit, the conservative <=512K registration, and that M2.5 is
  retained as legacy pricing.

No runtime behavior change beyond the M2.5 pricing restoration; existing
M3 / M2.7 pricing values are unchanged.

---------

Co-authored-by: octo-patch <octo-patch@github.com>
2026-06-03 20:08:11 +08:00
Alfred
7e54c6c3ba feat: add analysis phase API plumbing (#1573) 2026-06-03 19:51:07 +08:00
123kaze
d8a067ba47 feat: improve first-run configuration validation (#1558)
* feat: improve first-run configuration validation

* fix: clarify invalid LLM channel validation
2026-06-02 23:44:05 +08:00
Alfred
3ea007ceb1 feat: 盘中决策护栏与 phase_decision 质量校验 P5 (#1563)
* feat: add phase decision guardrails

* fix: neutralize non-intraday immediate actions

* test: cover low-confidence non-intraday actions
2026-06-02 23:19:10 +08:00
zbl-96
81c0287803 feat: 新增个股栏与自选队列操作 (#1540)
* feat: add stock bar sidebar and watchlist management

- Replace history list sidebar with stock bar that deduplicates stocks
  and places market review at top, ordered by latest analysis time
- Add GET /api/v1/history/stocks endpoint for distinct stock list
- Add code normalization to merge code variants (e.g. 002460 / 002460.SZ)
- Add GET/POST /api/v1/stocks/watchlist CRUD endpoints
- Add watchlist card to report detail right sidebar
- Add watchlist buttons to chat/ask page with auto stock code detection
- Add useWatchlist hook for shared watchlist state management
- Update CHANGELOG with [Unreleased] flat entries

Refs #1530

* fix: use canonical normalize_stock_code for stock code dedup

Replace ad-hoc suffix stripping with the existing normalize_stock_code
in data_provider/base.py, which handles all supported variants:
SH600519 / 600519.SH / HK00700 / 00700.HK / BJ920748 / 920748.BJ.

Addresses Codex P2 suggestion on PR #1540.

* fix: address PR review feedback on #1540

1. Fix extractStockCodeFromMessage to reject exchange prefixes
   (SH/SZ/BJ/HK/US/SS) as standalone tickers; add explicit patterns
   for SH600519/SZ000001/BJ920748 prefix formats.
   Move function to utils/chatStockCode.ts to satisfy react-refresh.

2. Add stock code validation and normalization in watchlist API
   (add/remove endpoints now validate format and use
   normalize_stock_code before persisting to STOCK_LIST).

3. Over-fetch distinct stocks (limit*3) before normalization dedup
   to avoid losing results when code variants shrink after grouping.

4. Update HomePage tests: remove batch-delete test scenario (sidebar
   replaced by StockBar), add getStockBarList/getWatchlist mocks,
   adjust assertions to match StockBarItem accessible names.

Refs #1540

* fix: normalize watchlist codes on read/write and strengthen validation

1. _read_watchlist_codes now normalizes and deduplicates all existing
   STOCK_LIST entries via normalize_stock_code, so hk00700/HK00700/00700.HK
   are treated as one canonical entry.
2. _write_watchlist_codes deduplicates before persisting.
3. _validate_and_normalize_stock_code uses regex matching against
   all supported stock code formats (aligned with frontend validateStockCode).
4. Restore accidentally deleted CHANGELOG entry for same-stock history trend.
5. Fix CHANGELOG/PR description API paths to match actual routes.

Refs #1540

* fix: normalize stock codes in frontend watchlist comparison

Add normalizeStockCode utility mirroring backend normalize_stock_code,
and use it in isInWatchlist so SH600519/600519.SH/HK00700/00700.HK
variants are all recognized as the same stock. Add 10 regression tests.

Refs #1540

* fix: normalize stock code variants in watchlist comparison and extraction

1. ChatPage.tsx: stockInWatchlist now normalizes input via normalizeStockCode
   before comparing against watchlistCodes, so SH600519/600519.SH variants
   are correctly recognized as already being in the watchlist.
2. chatStockCode.ts: add \d{1,5}\.HK suffix pattern (e.g. 00700.HK → HK00700),
   and return normalizeStockCode(normalized) for all extracted codes.
3. stocks.py: add bare 5-digit HK code (\d{5}) to _STOCK_CODE_RE regex.
4. ChatPage tests: add mockGetWatchlist/AddToWatchlist/RemoveFromWatchlist mocks,
   add 2 regression tests for watchlist button with code variants
   (600519.SH → 600519 and 1810.HK → HK01810).

Refs #1540

* fix: keep STOCK_LIST as-is, normalize only for comparison

Revert read/write normalization in _read_watchlist_codes and
_write_watchlist_codes. STOCK_LIST is now stored exactly as the user
input, without auto-normalization. Add/remove endpoints normalize
only for duplicate/matching comparison, preserving raw codes.

Refs #1540

* feat: restore batch delete in StockBar and add delete-by-code API

1. Add DELETE /api/v1/history/by-code/{stock_code} endpoint to delete
   all history records for a given stock code in one call.
2. Add deleteByCode function to frontend historyApi.
3. StockBar: restore select-all checkbox and batch delete button,
   matching the original HistoryList UX.
4. StockBarItem: add per-item delete button (trash icon, visible on hover).
5. HomePage: wire handleDeleteStock to StockBar, refresh stock bar and
   history after deletion.
6. Update CHANGELOG to reflect restored batch delete capability.

Refs #1540
2026-06-02 23:16:46 +08:00
Alfred
3e0858951d feat: add phase data quality prompt guards (#1546) 2026-06-01 20:30:02 +08:00
mumu
72213437f2 feat: add lightweight AlphaSift screening integration (#1443)
* feat: add lightweight AlphaSift screening integration

* fix(review-feedback-1443): 解决冲突后重新确认受影响文件和 CI 结果 and Restrict install spec before executing pip

* fix(review-feedback-1443): add a feature/auth gate before invoking installation side effects

* fix: repair AlphaSift enable flow

* fix(review-feedback-1443): Enable config before calling AlphaSift install

* fix(review-feedback-1443): re-fetch status in the error path to avoid this UI/backend state

* fix(review-feedback-1443): 补充对应回归测试

* fix(review-feedback-1443): 补充对应测试

* fix(review-feedback-1443): api/v1/endpoints/alphasift.py 的状态接口会返回 ALPHASIFT INSTALL SPEC,而项目默认

* fix(review-feedback-1443): 补一个前端用例覆盖

* fix(review-feedback-1443): 解决冲突后再合入

* fix(review-feedback-1443): 解决后再重新确认 diff 与 CI 结果

* fix(review-feedback-1443): 解决冲突并确认解决后的 diff 未引入新风险

* fix(review-feedback-1443): Read picks from AlphaSift ScreenResult and Use AlphaSift's actual

* fix(review-feedback-1443): 修正

* fix(review-feedback-1443): 解决冲突并重新确认 CI/Web gate 结果

* fix(review-feedback-1443): 解决冲突并重新确认 CI/Web gate,另外需要澄清本次 diff 中 LLM 配置相关改动是否属于本 PR 范围及其兼容性影响

* fix(review-feedback-1443): 解决冲突,并补齐受影响前端构建/测试验证后再合入

* fix(review-feedback-1443): 解决冲突,并补齐受影响前端 Web gate 或等价 CI 证据后再合入

* fix(review-feedback-1443): 解决冲突,并补齐受影响 Web gate 与兼容性验证说明后再合入

* fix(review-feedback-1443): mark this field sensitive and/or display only a masked/sanitized source

* fix(review-feedback-1443): 解决冲突,并补齐受影响前端验证与外部兼容性说明后再合入

* fix(review-feedback-1443): 解决冲突,并补齐冲突解决后的验证结果后再合入

* fix(review-feedback-1443): 解决冲突,并补齐受影响后端/Web 验证证据后再合入

* fix(review-feedback-1443): 解决冲突后基于最终 head 重新给出验证结论,否则无法确认最终合入内容与当前审查内容一致

* fix(review-feedback-1443): 解决冲突并补齐冲突后的验证结论

* fix(review-feedback-1443): Clear stale candidates when strategy changes

* fix(review-feedback-1443): preserve TestClient cookies across requests

* fix(review-feedback-1443): 解决冲突并基于冲突后的最终 head 重新确认受影响验证,当前不能直接合入

* fix(review-feedback-1443): 补回归测试

* fix(review-feedback-1443): 补后端回归测试

* fix(review-feedback-1443): 解决冲突,并在解决后重新给出基于最终 head 的验证结果

* fix(review-feedback-1443): 解决冲突并基于最终 diff 重新确认验证结果

* fix(review-feedback-1443): 解决冲突,并在冲突解决后的最终 head 上重新给出后端与 Web 相关验证结论

* fix(review-feedback-1443): 解决冲突,并在最终 head 上重新确认后端、Web 和文档改动仍一致

* fix(review-feedback-1443): 当前 PR 存在合并冲突,虽然 CI 摘要为 success,但冲突解决后的最终代码和验证结果尚未形成,当前不能直接合入

* fix(review-feedback-1443): 解决冲突并补齐验证

* fix(review-feedback-1443): 解决冲突

* fix(review-feedback-1443): 修正测试客户端生命周期问题,并补齐前端 lint/build 验证

* fix(review-feedback-1443): 解决冲突

* feat: refine AlphaSift adapter integration

* fix: restore settings help metadata for CI

* fix(review-feedback-1443): Do not run lifespan for non-context TestClient requests

* fix(review-feedback-1443): Pin AlphaSift install source to an immutable ref

* fix(review-feedback-1443): 补齐后再合入

* fix: harden alphasift review feedback

* fix(review-feedback-1443): api/v1/endpoints/alphasift.py:自动安装路径在 adapter 可导入但 get status 返回

* fix: package alphasift endpoint in desktop build

* fix: bundle alphasift in desktop builds

* fix(review-feedback-1443): docs/alphasift-integration.md 中 AlphaSift adapter contract /

* fix: honor empty alphasift install spec

* fix: bundle alphasift in docker image
2026-05-31 23:12:23 +08:00
Alfred
3e98dfd9bc feat: add analysis context data quality scoring (#1539) 2026-05-31 23:10:30 +08:00
Alfred
9f14850265 feat: add intraday realtime quality metadata (#1538)
Refs #1386

Refs #1389
2026-05-31 21:05:12 +08:00
mumu
9178e03762 fix: improve notification report rendering (#1531)
* fix: improve notification report rendering

* fix: polish chat report rendering output

* fix: add chat-optimized report layout

* fix: use chat report for im image routing

* fix: adapt im report formatting per channel

* fix: make im reports decision cards

* chore: reserve notification renderer presets

* docs: trim notification rendering guidance

* fix(review-feedback-1531): preserve valid links but escape non-link Telegram Markdown characters

* fix(review-feedback-1531): Chunk Telegram fallback before sending raw text

* fix(review-feedback-1531): avoid stripping arbitrary leading whitespace here

* fix: preserve legacy notification report formatting

* fix(review-feedback-1531): 补齐外部模型/API 与运行时配置迁移命中的排除说明或兼容性证据
2026-05-31 19:45:12 +08:00
Alfred
f42b395745 feat: add market phase summary metadata (#1532) 2026-05-31 09:24:58 +08:00
mumu
47c287a062 feat: add same-stock history trend drawer (#1524)
* feat: add same-stock history trend drawer

* fix(review-feedback-1524): 澄清外部模型/API 兼容性检测点,说明本 PR 是否仅展示历史记录中的模型字段,是否不改变 provider/model/Base

* fix: refine stock history drawer layout

* fix(review-feedback-1524): preserve suffixed codes when filtering history

* fix: match stock history issue interaction

* fix(review-feedback-1524): 修复同股代码等价匹配漏查,以及前端抽屉在分页/时间范围下的记录注入与去重问题

* fix(review-feedback-1524): 确认并修复当前同股历史抽屉在空结果时间范围下的交互阻断问题

* fix(review-feedback-1524): CI 当前未通过:结构化事实显示 docker-build:failure、web-gate:failure,而 AGENTS.md 将

* fix: refine stock history trend page

* fix(review-feedback-1524): 修复同股代码等价匹配漏查和市场复盘切换时抽屉状态残留两个正确性问题
2026-05-30 21:01:34 +08:00
mumu
24ca7e5309 fix: SSRF bypass in daily_stock_analysis (#1500) (#1511)
* fix(issue-1500): ssrf-bypass-in-daily_stock_analysis

* fix(review-feedback-1511): 解决冲突

* fix(review-feedback-1511): canonicalize or reject these numeric host forms before returning success

* fix(review-feedback-1511): 修正 docs/CHANGELOG.md 的发布段落污染问题,并补齐本次 LLM/Base URL 校验收紧的兼容性/迁移说明或验证依据

* fix(review-feedback-1511): 补充兼容性依据与已验证范围

* fix: block IPv4-mapped metadata base URLs

* fix: trim LLM base URL hardening

* fix(review-feedback-1511): 补齐 Unicode/IDNA 归一化后的受限地址拦截,避免 SSRF 修复仍存在绕过面
2026-05-30 17:46:53 +08:00
Alfred
0295f9d709 feat: expose analysis context pack overview (#1515)
Refs #1389
2026-05-30 09:20:11 +08:00
Alfred
b1579bb13d fix: localize backtest UI and settings help (#1514) 2026-05-30 09:18:57 +08:00
mumu
647b9d24e5 fix: support Longbridge OAuth token cache (#1490)
* fix: support Longbridge OAuth token cache

* fix(review-feedback-1490): bump the runtime dependency minimum or fail with a clear upgrade

* fix(review-feedback-1490): 补充对应回归测试

* fix(review-feedback-1490): Point OAuth cache at the dsa home in Docker

* fix(review-feedback-1490): 修复或给出明确的 CI 重跑通过证据

* fix(review-feedback-1490): 处理 Docker/Actions 持久化 token cache 已损坏时无法被新的 LONGBRIDGE OAUTH TOKEN

* fix: tighten Longbridge OAuth compatibility

* fix: refresh stale Longbridge OAuth cache

* fix: guard Longbridge OAuth SDK availability
2026-05-29 23:08:16 +08:00
mumu
35f26bdc73 fix: 交互式消息只回对应渠道而非全局广播 (#1501) (#1502)
* fix(issue-1501): [feature]-飞书同时配置了两种推送方式的改进

* fix(review-feedback-1502): 补齐非飞书交互式上下文的处理与回归测试
2026-05-29 22:53:48 +08:00
Alfred
c6cad83232 chore: extract analysis artifacts helpers (#1505) 2026-05-28 20:48:52 +08:00
Alfred
8aa214acc2 feat: 接入 AnalysisContextPack 低敏 Prompt 摘要 P3 (#1491)
* feat: inject AnalysisContextPack prompt summary

* fix: align agent pack summary with prefetched news
2026-05-28 19:04:17 +08:00
LouisHong
c1b17bc5ec fix: [issue #1446] 支持股票自动补全索引远程刷新 (#1480)
* feat: add remote stock index cache refresh

* test: cover remote stock index cache refresh

* docs: document remote stock index updates

* fix: harden stock index refresh and selection

* fix: stabilize stock index fallback selection
2026-05-27 20:55:37 +08:00
Alfred
bc14f70819 feat: add AnalysisContextPack P2 assembler from pipeline artifacts (#1478)
Introduce a zero-fetch builder that assembles internal AnalysisContextPack from existing pipeline artifacts, with tests and P2 contract docs for #1389.
2026-05-27 20:40:59 +08:00
Alfred
0bb515cc5e fix: 问股 single-agent 增加 provider-aware trace (#1473)
* fix: add provider-aware trace for ask chat

* fix: drop mismatched provider trace attempts
2026-05-26 19:13:05 +08:00
LouisHong
dad1883561 feat: [issue #1199 PR3] 补齐 Web 设置页实际展示字段帮助信息 (#1450)
* feat: add PR3 Web settings help metadata

* test: enforce Web settings help metadata coverage

* docs: clarify PR3 settings help slice

* docs: add PR3 settings help CHANGELOG entries
2026-05-26 08:51:34 +08:00
mumu
1ad07ba81e feat: add #1391 Phase 3 web diagnostic summaries (#1445)
* fix(issue-1412): [bug]-stock_list格式问题

* fix(review-feedback-1413): preserve exchange hint for dotted A-share inputs

* fix(review-feedback-1413): Keep normalized A-share codes usable by market routing and preserve

* fix(review-feedback-1413): Limit raw dotted codes to fetchers that can parse them

* fix(review-feedback-1413): Keep Tushare daily input normalized for ETF detection

* fix(review-feedback-1413): 澄清结构化检测中的外部模型/API 与运行时配置迁移风险

* fix(review-feedback-1413): 处理或明确确认该失败与本 PR 无关且已有维护者豁免依据

* fix: keep stock list input as bare codes

* docs: add phase-0 run diagnostics contract

* fix(review-feedback-1435): 修正描述并澄清/补齐运行时代码变更的验证证据

* fix(review-feedback-1435): 补齐前缀提示识别,并增加对应回归测试

* fix(review-feedback-1435): 修正

* fix(review-feedback-1435): 解决冲突并更新描述/验证记录后再合入

* fix(review-feedback-1435): 解决冲突,并在最终 head 上重新确认 python -m pytest tests/test a share fetcher code

* fix(review-feedback-1435): 修复并补齐回归覆盖后再复核最终 head

* fix(review-feedback-1435): data provider/baostock fetcher.py 的 convert stock code 只从 .SH/.SS/.SZ

* fix: preserve A-share exchange hints

* fix(review-feedback-1435): 修正 docs/run-diagnostics-p0.md 对 Tushare 本轮范围的矛盾描述

* feat: add phase 1 run diagnostics trace plumbing

* feat: add phase 2 run diagnostic summaries

* feat: add phase 3 web diagnostic summaries

* fix(review-feedback-1445): Retry diagnostics fetch instead of permanently short-circuiting

* fix(review-feedback-1445): 解决冲突并确认 CI 仍为 success

* fix(review-feedback-1445): Persist diagnostics after notification dispatch

* docs(run-diagnostics): Clarify LLM config compatibility boundary for Phase 2

* fix: resolve undefined variable and test timing issues in diagnostics

* fix(review-feedback-1445): 澄清并补齐验证

* fix(review-feedback-1445): 解决的 merge conflict

* fix(review-feedback-1445): 解决冲突,并补齐后端/API 变更说明与验证证据

* fix(review-feedback-1445): 解决冲突,并在冲突解决后重新确认受影响检查仍通过

* fix(review-feedback-1445): 澄清并补齐模型/provider/Base URL/运行时配置迁移相关证据,避免与 PR 风险说明不一致

* fix(review-feedback-1445): 解决冲突,并在冲突解决后确认关键 Web 与后端诊断路径仍通过验证

* fix(review-feedback-1445): Scope channel diagnostics to stocks actually notified

* fix(review-feedback-1445): Count source-context delivery as notification success and update

* fix(review-feedback-1445): 解决冲突后再合入
2026-05-26 08:48:51 +08:00
mumu
8a23124d01 feat: add #1391 Phase 2 run diagnostic summaries (#1444)
* fix(issue-1412): [bug]-stock_list格式问题

* fix(review-feedback-1413): preserve exchange hint for dotted A-share inputs

* fix(review-feedback-1413): Keep normalized A-share codes usable by market routing and preserve

* fix(review-feedback-1413): Limit raw dotted codes to fetchers that can parse them

* fix(review-feedback-1413): Keep Tushare daily input normalized for ETF detection

* fix(review-feedback-1413): 澄清结构化检测中的外部模型/API 与运行时配置迁移风险

* fix(review-feedback-1413): 处理或明确确认该失败与本 PR 无关且已有维护者豁免依据

* fix: keep stock list input as bare codes

* docs: add phase-0 run diagnostics contract

* fix(review-feedback-1435): 修正描述并澄清/补齐运行时代码变更的验证证据

* fix(review-feedback-1435): 补齐前缀提示识别,并增加对应回归测试

* fix(review-feedback-1435): 修正

* fix(review-feedback-1435): 解决冲突并更新描述/验证记录后再合入

* fix(review-feedback-1435): 解决冲突,并在最终 head 上重新确认 python -m pytest tests/test a share fetcher code

* fix(review-feedback-1435): 修复并补齐回归覆盖后再复核最终 head

* fix(review-feedback-1435): data provider/baostock fetcher.py 的 convert stock code 只从 .SH/.SS/.SZ

* fix: preserve A-share exchange hints

* fix(review-feedback-1435): 修正 docs/run-diagnostics-p0.md 对 Tushare 本轮范围的矛盾描述

* feat: add phase 1 run diagnostics trace plumbing

* feat: add phase 2 run diagnostic summaries

* fix(review-feedback-1441): 打通 trace id 与数据源运行快照,改动目标明确

* fix(review-feedback-1444): 修复 Agent 模式新报告通过历史诊断 API 返回 unknown 的正确性问题

* fix(review-feedback-1444): Propagate diagnostics lookup errors instead of masking them

* fix(review-feedback-1444): 补对应回归断言

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突

* fix(review-feedback-1444): 解决冲突

* fix(review-feedback-1444): 解决

* fix(review-feedback-1444): 解决

* fix(review-feedback-1444): 解决冲突

* fix(review-feedback-1444): 解决

* fix(review-feedback-1444): 解决

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突

* fix(review-feedback-1444): Derive news diagnostics from retrieval evidence

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突并基于解决后的最终 diff 重新确认 docs/CHANGELOG.md、诊断链路和测试结果

* fix(review-feedback-1444): 解决冲突

* fix(review-feedback-1444): 解决冲突后再合入

* fix(review-feedback-1444): 解决冲突并重新跑阻断型 CI,尤其是 backend-gate 和相关诊断/API/history 回归

* fix(review-feedback-1444): preserve report timestamp when enriching task results

* fix: address run diagnostics review feedback

* fix: redact diagnostic copy text secrets

* fix(review-feedback-1444): 补一条多渠道部分失败的回归测试
2026-05-26 00:05:24 +08:00
mumu
e0e5fa6870 feat: add #1391 Phase 1 run diagnostics trace plumbing (#1441)
* fix(issue-1412): [bug]-stock_list格式问题

* fix(review-feedback-1413): preserve exchange hint for dotted A-share inputs

* fix(review-feedback-1413): Keep normalized A-share codes usable by market routing and preserve

* fix(review-feedback-1413): Limit raw dotted codes to fetchers that can parse them

* fix(review-feedback-1413): Keep Tushare daily input normalized for ETF detection

* fix(review-feedback-1413): 澄清结构化检测中的外部模型/API 与运行时配置迁移风险

* fix(review-feedback-1413): 处理或明确确认该失败与本 PR 无关且已有维护者豁免依据

* fix: keep stock list input as bare codes

* docs: add phase-0 run diagnostics contract

* fix(review-feedback-1435): 修正描述并澄清/补齐运行时代码变更的验证证据

* fix(review-feedback-1435): 补齐前缀提示识别,并增加对应回归测试

* fix(review-feedback-1435): 修正

* fix(review-feedback-1435): 解决冲突并更新描述/验证记录后再合入

* fix(review-feedback-1435): 解决冲突,并在最终 head 上重新确认 python -m pytest tests/test a share fetcher code

* fix(review-feedback-1435): 修复并补齐回归覆盖后再复核最终 head

* fix(review-feedback-1435): data provider/baostock fetcher.py 的 convert stock code 只从 .SH/.SS/.SZ

* fix: preserve A-share exchange hints

* fix(review-feedback-1435): 修正 docs/run-diagnostics-p0.md 对 Tushare 本轮范围的矛盾描述

* feat: add phase 1 run diagnostics trace plumbing

* fix(review-feedback-1441): 打通 trace id 与数据源运行快照,改动目标明确
2026-05-25 21:01:40 +08:00
Alfred
3aa26ba7d8 feat: add visible chat context compression (#1460)
Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-05-25 20:31:20 +08:00
Alfred
1c049bc490 feat: add analysis context pack schema (#1449) 2026-05-25 20:28:18 +08:00
Alfred
79b284014d feat: inject market phase prompt context (#1442) 2026-05-25 20:27:24 +08:00
zbl-96
639796f982 fix: restore board linkage for compatible history snapshots (#1416)
* fix: restore board linkage from compatible snapshots

* chore: drop local review artifact from pr

* fix: enrich in-memory status board details

* fix: merge partial fundamental snapshots

* fix: preserve fallback fields on empty snapshots

---------

Co-authored-by: ZhuLinsen <zhuls97@163.com>
2026-05-24 19:20:25 +08:00
Alfred
a3c627c384 feat: add runtime market phase context plumbing (#1434)
Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-05-24 15:00:53 +08:00
Alfred
c452e7ff09 docs: complete alert center P8 documentation (#1430) 2026-05-23 21:56:53 +08:00
Alfred
f98b7271fa feat: add market phase inference baseline (#1424)
Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-05-23 19:22:01 +08:00
Alfred
bdb988390e feat: add P7 market light alerts (#1419)
Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-05-23 19:19:03 +08:00
vinvcn
2c26203c24 fix: normalize Tencent realtime volume (#1409)
* fix: normalize Tencent realtime volume

* fix: harden Tencent realtime normalization

* docs: localize Tencent realtime comments

---------

Co-authored-by: mumu <42829555+ZhuLinsen@users.noreply.github.com>
2026-05-22 22:42:05 +08:00
TianleZhang
bb814ff89d feat: 邮件报告补充 财务摘要 / 股东回报 / 关联板块,并接入 HK/US 基本面 (#1369)
* feat: enrich email report with financial / dividend / related-boards blocks for CN/HK/US

Render three structured sections in single-stock and dashboard markdown reports
(used by email and other static channels) sourced from fundamental_context:

- 财务摘要: report date, revenue, parent net profit, operating cash flow, ROE,
  YoY growth, gross margin
- 股东回报: TTM cash dividend per share (pre-tax), TTM event count, TTM yield,
  latest ex-dividend date
- 关联板块: belong_boards with sector-leading/lagging signal & change_pct when
  available; auto-collapses to a 2-col (name / type) layout when no sector
  ranking data exists (typical for HK/US)

To unlock the offshore (HK/US) data path:

- Add YfinanceFundamentalAdapter producing the same bundle shape as the
  AkShare adapter, with growth, financial_report (incl. currency),
  TTM dividend events, and sector+industry as belong_boards
- Route get_fundamental_context for hk/us through a new
  _build_offshore_fundamental_context helper instead of short-circuiting
  to not_supported; keep capital_flow / dragon_tiger / boards as
  not_supported (no equivalent feed)
- Stop overwriting belong_boards in the pipeline for non-CN markets so the
  adapter-provided sector/industry data survives

Notification renderer:

- Attach fundamental_context onto AnalysisResult so the notification layer
  can reach it without an extra DB round-trip
- Currency-aware formatting: USD -> 亿/万美元, HKD -> 亿/万港元,
  CNY/other -> 亿/万元; per-share amounts get the same suffix
- Right-align numeric columns and center the report-date column in the
  financial summary and shareholder return tables for cleaner rendering

Tests:

- Offline coverage for the new yfinance adapter (symbol conversion, bundle
  shape, refusal to use QoQ as YoY, graceful degradation when yfinance is
  unavailable)
- Offshore market path through DataFetcherManager.get_fundamental_context
- Adaptive related-boards rendering (2-col when no sector signal,
  4-col when at least one row carries data)
- Currency-aware amount formatting for AAPL (USD) and HK09988 (CNY)

* fix: split financial vs dividend currency and recompute TTM yield for HK/US

HK ADRs typically report financialCurrency=CNY but pay dividends in HKD
(live yfinance confirms: 9988.HK / 0700.HK both have financialCurrency=CNY
and currency=HKD; BABA US ADR has financialCurrency=CNY and currency=USD).
Previously the adapter wrote a single currency field shared by both the
financial report and the dividend block, which rendered HK dividends as
yuan in the email report.

This change writes earnings.financial_report.currency from
info.financialCurrency and earnings.dividend.currency from info.currency
independently, and the notification renderer reads each block's own
currency (falling back to financial_report.currency when dividend.currency
is absent, which keeps AkShare A-share rendering unchanged).

TTM dividend yield was sourced from info.dividendYield, mixing the
numerator (TTM cash window) with a denominator-defined yield from a
different yfinance computation. The yield is now recomputed as
ttm_cash_dividend_per_share / latest_price * 100 with both sides in the
trading currency (latest_price falls through info.currentPrice ->
regularMarketPrice -> previousClose). info.dividendYield is now a
last-resort passthrough (no *100, since current yfinance already returns
percent), behind info.trailingAnnualDividendYield (decimal).

Docs (full-guide / full-guide_EN) updated: HK/US now returns
valuation/growth/earnings/belong_boards rather than not_supported, with
the dual-currency split and the TTM yield formula explicitly documented.
CHANGELOG entries rewritten to reflect the corrected behavior.

Verified live against 9988.HK / 0700.HK / AAPL / 600519: the rendered
email shows financial summary in 亿元 for HK ADRs (CNY statements) while
the shareholder return block shows 港元 (HKD dividends), and the
recomputed yields match ttm_cash / latest_price in the same currency.

---------

Co-authored-by: suan baby <suanai@tianle.me>
2026-05-21 20:04:32 +08:00
Alfred
2caa1292e9 feat: add P6 portfolio and watchlist alerts (#1379) 2026-05-21 19:15:24 +08:00
mumu
b7d449783c fix: 资金流数据缺失 (#1367) (#1368)
* fix(issue-1367): [bug]-资金流数据缺失

* fix(review-feedback-1368): preserve agent-provided chip data when prefetch is unavailable and

* fix(review-feedback-1368): 补充具体受影响文件/字段、是否会清理或迁移用户已有配置、用户可见恢复方式,以及对应回归测试或确认不涉及运行时行为的证据

* fix(review-feedback-1368): 结构化检测显示本 PR 涉及模型名、provider、Base URL、废弃日期、LiteLLM 或 LLM

* docs: trim issue 1367 compatibility notes

* docs: keep issue 1367 note in changelog only
2026-05-20 23:32:14 +08:00
mumu
8be6546caa feat: improve stock news relevance ranking
Improve stock-news relevance scoring and ranking.

Fix lower-case US ticker suffix matching, preserve Chinese preference for A/HK weakly-related news, and cover the addressed review edge cases.
2026-05-20 22:49:25 +08:00