Skip to content

允许 - #873

Closed
Shzzzy wants to merge 9 commits into
ZhuLinsen:mainfrom
Shzzzy:main
Closed

允许#873
Shzzzy wants to merge 9 commits into
ZhuLinsen:mainfrom
Shzzzy:main

Conversation

@Shzzzy

@Shzzzy Shzzzy commented Mar 27, 2026

Copy link
Copy Markdown

PR Type

  • fix
  • feat
  • refactor
  • docs
  • chore
  • test

Background And Problem

请描述当前问题、影响范围与触发场景。
(EN) Describe the problem, its impact, and what triggers it.

Scope Of Change

请列出本 PR 修改的模块和文件范围。
(EN) List the modules and files changed in this PR.

Issue Link

必须填写以下之一 / Fill in one of:

  • Fixes #<issue_number>
  • Refs #<issue_number>
  • 无 Issue 时说明原因与验收标准 / If no issue, explain the motivation and acceptance criteria

Verification Commands And Results

请填写你实际执行过的命令和关键结果(不要只写"已测试")。
(EN) Paste the commands you actually ran and their key output (don't just write "tested"):

# example
./scripts/ci_gate.sh
python -m pytest -m "not network"

关键输出/结论 / Key output & conclusion:

Compatibility And Risk

请说明兼容性影响、潜在风险(如无请写 None)。
(EN) Describe compatibility impact and potential risks (write None if not applicable).

Rollback Plan

请至少写一句可执行的回滚方案(必填)。
(EN) Provide at least one actionable rollback step (required).

EXTRACT_PROMPT Change (if applicable)

若本 PR 修改了 src/services/image_stock_extractor.py 中的 EXTRACT_PROMPT,请在此处粘贴完整变更后的 prompt。
If this PR changes EXTRACT_PROMPT in src/services/image_stock_extractor.py, paste the full updated prompt here:

展开 / Expand: Full EXTRACT_PROMPT
(paste full prompt here)

Checklist

  • 本 PR 有明确动机和业务价值 / This PR has a clear motivation and value
  • 已提供可复现的验证命令与结果 / Reproducible verification commands and results are included
  • 已评估兼容性与风险 / Compatibility and risk have been assessed
  • 已提供回滚方案 / A rollback plan is provided
  • 若涉及用户可见变更,已同步更新相关文档与 docs/CHANGELOG.md;若未更新 README.md,已说明原因与文档落点 / If user-visible changes are included, the relevant docs and docs/CHANGELOG.md are updated; if README.md was not updated, the reason and documentation location are explained

Shzzzy added 7 commits March 27, 2026 14:13
时间改为14.30
添加右侧量化过滤
根据stock_list执行右侧量化分析
改为绝对路径+debug查看当前路径
修正启动方式
@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown

🤖 自动审查报告

项目 结果
📊 变更文件 2 个
➕ 新增行数 34 行
➖ 删除行数 1 行
🔍 静态检查 ✅ 通过
🧠 AI 审查 ✅ 已完成

📁 修改的文件

  • 🆕 .github/scripts/right_side_selector.py (+29/-0)
  • 📝 .github/workflows/daily_analysis.yml (+5/-1)

🧠 AI 代码审查意见

本次 PR 审查结论:Not Ready


结构化审查结果

  • 必要性不通过
    • 理由:PR 描述中“背景与问题”为空,未能阐明本次变更的明确动机和业务价值。虽然从代码层面可以推断出实现了一个股票筛选逻辑,但缺乏正式的说明。
  • 关联性不通过
    • 证据:PR 描述中“Issue Link”为空,且未说明无 Issue 的原因和验收标准。
  • 类型判定:建议类型为 feat
    • 理由:本次 PR 引入了一个新的 Python 脚本,实现了具体的股票筛选逻辑,并调整了工作流以使用该逻辑,这属于新增功能范畴。
  • 描述完整性不完整
    • 缺失项:PR 类型、背景与问题、变更范围、Issue 链接/无 Issue 时说明、验证命令与结果、兼容性与风险、回滚方案、Checklist 均为空或未填写。
  • 风险级别
    • 关键风险
      1. 工作流中断风险daily_analysis.yml 中设置 STOCK_LIST 环境变量的步骤依赖于一个不存在的文件 (stock_list.txt),将导致该环境变量设置失败,进而影响后续依赖此变量的分析任务。
      2. 数据准确性与稳定性:新增的股票筛选脚本 right_side_selector.py 未包含错误处理,例如 akshare 数据源获取失败或筛选后列表为空的情况,可能导致脚本运行时报错或返回意外结果。
      3. 定时任务时间变更影响daily_analysis.yml 中定时任务的执行时间从北京时间 18:00 (UTC 10:00) 调整为北京时间 14:25 (UTC 06:25)。此变更未在 PR 描述中解释,可能对数据时效性和业务分析结果产生重要影响。

必改项 (最多 5 条)

  1. 修复 STOCK_LIST 环境变量设置逻辑
    • 文件.github/workflows/daily_analysis.yml
    • 问题:工作流中的 Export STOCK_LIST 步骤预期通过 cat stock_list.txt 读取内容,但 right_side_selector.py 脚本仅将结果打印到标准输出,并未创建 stock_list.txt 文件。这将导致 cat 命令失败,STOCK_LIST 环境变量无法被正确设置,从而影响后续依赖该变量的分析任务。
    • 修改建议:将 right_side_selector.py 的输出直接捕获到环境变量中。示例:
          - name: Run stock selector and export STOCK_LIST
            run: |
              STOCK_LIST=$(python .github/scripts/right_side_selector.py)
              echo "STOCK_LIST=$STOCK_LIST" >> $GITHUB_ENV
  2. 补充完整的 PR 描述
    • 问题:PR 描述中的所有必填字段(包括类型、背景、范围、Issue 链接/原因、验证结果、兼容性与风险、回滚方案、Checklist)均为空或未填写。这严重阻碍了对 PR 目的、影响和风险的全面理解。
    • 修改建议:请按照 PR 模板要求,逐一填写所有字段,特别是“背景与问题”、“Issue Link”(或无 Issue 时的说明)以及“验证命令与结果”。
  3. 提供回滚方案
    • 问题:PR 描述中“Rollback Plan”为空,不符合要求。
    • 修改建议:请至少提供一句可执行的回滚方案,例如“回滚此 PR 的所有提交到上一个稳定版本”。

建议项 (最多 5 条)

  1. 完善 right_side_selector.py 的健壮性
    • 文件.github/scripts/right_side_selector.py
    • 问题:脚本缺少错误处理,例如 akshare 获取数据失败或所有股票都被过滤导致 DataFrame 为空时,脚本可能会出错。
    • 修改建议:增加 try-except 块处理 akshare 调用失败的情况;在 df 为空时返回空字符串或进行适当的日志记录。
  2. 解释定时任务时间变更的原因
    • 文件.github/workflows/daily_analysis.yml
    • 问题cron 表达式从 0 10 * * 1-5 变更为 25 6 * * 1-5,这将日常分析的执行时间从北京时间 18:00 提前到 14:25。这是一个重要的业务逻辑变更,但在 PR 描述中未做任何说明。
    • 修改建议:在 PR 描述的“Background And Problem”或“Compatibility And Risk”中解释此时间变更的原因和预期影响。
  3. 遵循 Issue 关联格式
    • 问题:PR 描述中“Issue Link”部分未按照 Fixes #<issue_number>Refs #<issue_number> 格式填写。
    • 修改建议:如果存在关联 Issue,请按规范格式填写;如果没有,请在 PR 描述中明确说明无 Issue 的原因和验收标准。
  4. 提供业务逻辑的验证命令与结果
    • 问题:PR 描述中“Verification Commands And Results”为空。虽然 CI 检查通过了语法,但对于新引入的股票筛选逻辑,需要有实际运行并验证其输出的证据。
    • 修改建议:提供运行 python .github/scripts/right_side_selector.py 的命令及关键输出截图或文本,以证明其逻辑正确性。
  5. 评估 docs/CHANGELOG.md 更新的必要性
    • 问题:如果此 PR 引入的股票筛选功能对用户可见(例如影响到某个报告或输出),则需要同步更新 docs/CHANGELOG.md。PR 描述中的 Checklist 未勾选,且未说明 CHANGELOG.md 的更新情况。
    • 修改建议:评估此变更是否属于用户可见的特性,并相应更新 docs/CHANGELOG.md 或在 PR 描述中说明未更新的原因。

💡 提示: 请确保代码已通过本地测试,并遵循项目代码规范。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95b1ce5cc8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/daily_analysis.yml Outdated
mkdir -p data logs reports

- name: Generate Right Side Pool
run: python3 ./scripts/right_side_selector.py > stock_list.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use the actual right-side selector path in workflow

The new workflow step runs python3 ./scripts/right_side_selector.py, but this commit adds the script at .github/scripts/right_side_selector.py, so the referenced path does not exist on the runner and the job will fail before main.py executes. This breaks the scheduled analysis run in every environment using this workflow.

Useful? React with 👍 / 👎.


- name: Export STOCK_LIST
run: |
echo "STOCK_LIST=$(cat stock_list.txt)" >> $GITHUB_ENV

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ensure generated STOCK_LIST is the value passed to analysis

This step exports a generated STOCK_LIST via $GITHUB_ENV, but the later 执行股票分析 step still defines STOCK_LIST explicitly from ${{ vars.STOCK_LIST || secrets.STOCK_LIST || '600519' }}, which shadows the generated value; as a result, the right-side pool computation has no effect and analysis continues using the static/default list. This causes silently incorrect stock selection rather than the intended dynamic list.

Useful? React with 👍 / 👎.

@ZhuLinsen ZhuLinsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评审结论

  • 必要性:通过,自动生成分析股票池并接入每日分析 workflow 属于与仓库主流程直接相关的能力变更。
  • 是否有对应 issue:无(未看到 Fixes/Refs,描述里也没有说明无 issue 时的验收标准)。
  • PR 类型:feat,新增右侧选股脚本并改动每日分析 workflow 的输入股票池与调度行为。
  • description 完整性:不完整,缺少 Background/Scope/Issue Link/实际验证结果/兼容性风险/回滚方案,也没有说明默认执行时间为何从 18:00 调整为 14:25,以及相关文档落点。
  • 是否可直接合入:不可,当前存在确定性的 workflow 接线错误,且调度语义与文档不一致,至少需要先修正脚本路径、让生成的 STOCK_LIST 真正传递到分析步骤,并补齐文档/变更记录。

主要问题

  1. .github/workflows/daily_analysis.ymlGenerate Right Side Pool 调用了 python3 ./scripts/right_side_selector.py,但本 PR 新增的文件实际在 .github/scripts/right_side_selector.py。按当前 diff,workflow 会在生成股票池这一步直接失败;现有 PR CI success 也没有覆盖这条 daily_analysis workflow。
  2. .github/workflows/daily_analysis.yml:前一步通过 $GITHUB_ENV 导出的 STOCK_LIST,会被“执行股票分析”步骤里的 step-level env.STOCK_LIST: ${{ vars.STOCK_LIST || secrets.STOCK_LIST || '600519' }} 覆盖。结果是右侧股票池并不会传给 main.py,本 PR 的核心能力实际上没有接入主流程。
  3. .github/workflows/daily_analysis.yml 及现有文档:cron 已从 0 10 * * 1-5 改为 25 6 * * 1-5,实际执行时间从北京时间 18:00 变成 14:25;但 workflow 注释、README.mddocs/full-guide.mddocs/DEPLOY.md 及对应中英文文档仍写 18:00,docs/CHANGELOG.md 也未更新。按 AGENTS.md,这类 workflow/部署语义变化需要同步文档与变更记录,否则运维预期会和实际运行时间分叉。
  4. .github/scripts/right_side_selector.py:新脚本直接调用 ak.stock_zh_a_spot_em(),没有复用仓库现有 data_provider 里的重试、缓存、熔断和降级路径。本仓库原本就在使用 AkShare,但本 PR 把这条依赖前移成 workflow 的硬前置,单一数据源抖动就会在进入 main.py 前终止整次分析,这和 AGENTS.md 里“单一数据源失败不应拖垮整个分析流程”的稳定性护栏相冲突。

🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。

@ZhuLinsen ZhuLinsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评审结论

  • 必要性:通过,自动生成分析股票池并接入 每日股票分析 workflow 属于与仓库主流程直接相关的能力变更。
  • 是否有对应 issue:无(未填写 Fixes/Refs,也未说明无 issue 时的验收标准)。
  • PR 类型:feat,新增右侧选股脚本并调整每日分析 workflow 的股票来源与定时行为。
  • description 完整性:不完整,模板中的 Background/Scope、Issue Link、实际验证结果、Compatibility And Risk、Rollback Plan 基本未填写;对于默认调度时间变更也未说明原因、影响范围和文档落点。
  • 是否可直接合入:不可。当前 CI 虽通过,但这次改动在实际 daily_analysis workflow 路径上存在运行时阻断,而且新增调度语义与现有文档不一致。

主要问题

  1. [Correctness blocker] .github/workflows/daily_analysis.yml 新增的 Export STOCK_LIST 步骤直接执行 cat stock_list.txt,但当前仓库和本 PR diff 中都没有 stock_list.txt,也没有任何先生成该文件的步骤。与此同时,新加的 .github/scripts/right_side_selector.py 在当前改动里没有被 workflow 调用。结果是:要么 workflow 在这里直接失败,要么新增脚本根本没有接入主流程,这个 feature 当前并未真正落地。
  2. [Correctness blocker] .github/workflows/daily_analysis.yml 虽然前一步尝试通过 GITHUB_ENV 导出 STOCK_LIST,但后面的“执行股票分析”步骤仍显式把 STOCK_LIST 绑定为 ${{ vars.STOCK_LIST || secrets.STOCK_LIST || '600519' }}。当前 diff 没有建立“选股脚本输出 -> 分析步骤输入”的明确数据通路,至少说明生成股票池并没有被可靠消费,行为依赖环境变量覆盖顺序,风险较高。
  3. [Process blocker] .github/workflows/daily_analysis.yml 的 cron 已从 0 10 * * 1-5 改成 25 6 * * 1-5,实际执行时间从北京时间 18:00 变成 14:25,但文件内注释仍写着“UTC 10:00 = 北京时间 18:00”。仓库里现有的 README.mddocs/full-guide.mddocs/DEPLOY.md 等通用文档也仍说明默认是 18:00。按 AGENTS.md,这类调度语义和用户可见 workflow 行为变化需要同步文档与 docs/CHANGELOG.md,或者至少说明为什么不更新 README.md 以及信息落点。当前是“已有通用文档,但本次新增语义未说明”,会直接造成运维预期与实际行为不一致。

🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。

@massif-01 massif-01 closed this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants