Repository navigation
fix(holdings): stock.holdings を欠く最新 report_data を読み飛ばす - #104
Merged
Merged
Conversation
最新の report_data が stock.holdings を持たないと保有が 0 件になり、 analyze.py --market jp/us の保有モードが空振りしていた。持つファイルまで 遡り、遡ったことを stderr に出す。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ghWwWfKwr9X9hwAaQaNQy
Ries630
marked this pull request as ready for review
October 29, 2026 01:46
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7654b43598
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ghWwWfKwr9X9hwAaQaNQy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by りーす · project thread
概要
analyze.py --market jp/us(引数なしの保有モード) で保有が空になる問題の修正。原因
lib/holdings.pyのlatest_report_path()が日付最新のreport_data_*.jsonを無条件に採っていた。最新ファイルがstock.holdingsを欠くとload_holdings()が 0 件を返し、analyze.pyは「対象市場の保有銘柄が見つからない」で終わる。同じ経路のheld_tickers()も Investment 側の保有が空になるため、screen.pyの母集団除外も効いていなかった。変更
latest_report_path()はstock.holdings(リスト) を持つ最新ファイルまで遡る。遡ったときは読み飛ばしたファイル名を stderr に[warn]で出す。基準日は遡った先のas_ofになり、保有ヘッダの経過日数に現れるstock.holdingsは「保有 0 件」として有効扱い (遡らない)stock.holdingsを持たなければFileNotFoundErrordocs/output-contract.mdの保有データの鮮度に読み方を追記Generated by Claude Code