Initial review date: 2026-04-09 Updated: 2026-04-10
This document summarizes the issues found during a repo review that included:
- reading the Claude project session logs under
/home/datafeed/.claude/projects/-home-datafeed-market-data-library-lseg-data-fetch - reading all Markdown files in this repo
- inspecting the main scripts and helpers in
equity_options/,credit/,dividend_derivatives/,shared/, andtests/
The review was primarily static. Python syntax compilation passed, but live LSEG API calls were not executed during this review.
- High: likely data loss, silent incompleteness, or invalid resume behavior
- Medium: important operational or portability issue, but not immediate silent corruption
- Low: documentation drift, usability issue, or tooling weakness
- Status: Resolved as of 2026-04-10
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/download_trades.py
- What changed:
- Both intraday downloaders now return and log an explicit
statusvalue. - Resume logic now only treats
okandemptyentries as cleanly completed. - Legacy log entries are handled with a compatibility rule instead of being blindly trusted.
- Both intraday downloaders now return and log an explicit
- Verification notes:
fetch_bars()/fetch_ticks()now returnstatus.- Worker log entries now include
"status": .... load_completed()now checksstatusbefore deciding a contract is done.
- Status: Resolved as of 2026-04-10
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/download_trades.py
- What changed:
- Workers now only append rows to CSV when the contract finished with
status == "ok". - Errored contracts are logged but their partial rows are not written out as if complete.
- Workers now only append rows to CSV when the contract finished with
- Verification notes:
- Both workers gate CSV writes on
if rows and status == "ok":.
- Both workers gate CSV writes on
- Status: Resolved as of 2026-04-10
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/download_trades.py
- What changed:
- The intraday downloaders now use direct OAuth password-grant + refresh-token handling.
- 401 responses call
tm.on_401(), which refreshes or fully re-authenticates. - The old
session._access_tokencopy pattern is no longer used in these scripts.
- Verification notes:
AUTH_URLis now used directly in both files.TokenManagerhasauthenticate(),refresh(), andon_401().
- Severity: High
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/download_trades.py
- Problem:
- Completed state is keyed only by
ric/base_ricin the log-based resume helper. - If
contracts.csvlater contains a correctedquery_ric, the contract still gets skipped because the base RIC already exists in the log. - The investigation notes suggest deleting only
om_run.logto rerun bad index names, butom_bars_log.jsonlwould still suppress the contracts.
- Completed state is keyed only by
- Why it matters:
- Wrong-RIC contracts cannot be repaired cleanly with the current resume behavior.
- Recommended fix:
- Make resume state compare both
base_ricand the currently expectedquery_ric. - Rerun when the current
query_ricdiffers from the most recent successful log entry.
- Make resume state compare both
- Severity: High
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/CLAUDE.mdequity_options/INDEX_RIC_INVESTIGATION.md
- Problem:
- The project now has many historical
bars=0entries from before the status-logging fix. - Current logs are better, but legacy zero-bar outcomes are still ambiguous.
- Some zero-bar clusters are likely real, but others may reflect bad RICs or transient failures.
- The project now has many historical
- Why it matters:
- The existing dataset likely contains a mix of real empties and false empties.
- Recommended fix:
- Add a repair/recheck pass that extracts prior zero-bar contracts and reruns them under the patched downloader.
- Track rechecks in a separate log or revisioned status field.
- Severity: High
- Area:
credit - Files:
credit/download_bond_master.py
- Problem:
- The docstring says that 1-day windows should split by
DbTypeand then by currency if still too large. - The implementation instead jumps directly to currency when a 1-day window is still over 10K.
- If a currency slice is still over 10K, the script logs a warning, downloads only the first 10K hits, and marks that window complete.
- The docstring says that 1-day windows should split by
- Why it matters:
- The bond security master can be incomplete without failing loudly.
- Recommended fix:
- Implement the documented split order.
- Treat any still-overflowing slice as unresolved rather than "done."
- Severity: Medium
- Area:
equity_options/expired_options_search/eof_scripts - Files:
equity_options/expired_options_search/eof_scripts/parse_cboe_snapshot.pyequity_options/expired_options_search/eof_scripts/build_top10_gap_rics.py
- Problem:
- These scripts still point to
/home/rakin/...and an old Claude tool-results path.
- These scripts still point to
- Why it matters:
- The intraday downloader may be portable now, but parts of the contract-generation workflow are not reproducible on this machine.
- Recommended fix:
- Replace absolute paths with repo-relative locations or explicit CLI arguments.
- Severity: Medium
- Area:
equity_options - Files:
equity_options/intraday_download_status.sh
- Problem:
- The script hardcodes an absolute
cd. - It assumes a specific
ps auxfield layout and infers the active ticker fromawk '{print $13}'. - It only recognizes
download_trades.py, not other trade-related processes.
- The script hardcodes an absolute
- Why it matters:
- Operational monitoring is fragile and can mislead you about what is actually running.
- Recommended fix:
- Resolve paths relative to the script directory.
- Parse process command lines more defensibly.
- Explicitly say when no matching trades downloader is running.
- Severity: Medium
- Area: whole repo
- Files:
- especially
dividend_derivatives/,credit/tests/,archive/, andequity_options/expired_options_search/eof_scripts/
- especially
- Problem:
- The repo contains a mix of active pipelines, exploratory scripts, old probes, and archival code.
- There is no consistent boundary between "current production tool" and "historical experiment."
- Why it matters:
- It is easy to use the wrong script or rely on stale logic.
- Recommended fix:
- Mark active scripts clearly and move superseded exploratory files into more explicit archive locations.
- Severity: Medium
- Area:
tests/,credit/tests/ - Files:
tests/test_lseg.pytests/test_rest_api.py- most
credit/tests/test_*.py
- Problem:
- Many scripts named like tests run live API requests, depend on credentials, and execute work at import time.
- This is not a stable automated regression suite.
- Why it matters:
- Running
pytestis not a reliable signal of repo health. - Some files also create temporary credential-bearing config files during execution.
- Running
- Recommended fix:
- Separate exploratory scripts from real tests.
- Add small pure unit tests for parsing, resume-state logic, status handling, and contract-loading behavior.
- Severity: Medium
- Area:
equity_options - Files:
equity_options/download_om_minute_bars.pyequity_options/download_trades.pyequity_options/build_ticker_contracts.py
- Problem:
- The most operationally important logic in the repo is resume behavior, but there are no focused tests around:
- log parsing
- log precedence
query_ricchanges- partial contract retries
- terminal vs non-terminal status classification
- The most operationally important logic in the repo is resume behavior, but there are no focused tests around:
- Why it matters:
- Regressions in resume behavior are easy to introduce and hard to detect after the fact.
- Recommended fix:
- Add unit tests for log interpretation and rerun eligibility.
- Severity: Low
- Area: docs
- Files:
CLAUDE.mdequity_options/HANDOFF_OM_MINUTE_BARS.mdequity_options/TODO.mdequity_options/notes.md
- Problem:
CLAUDE.mdreflects the current full-history, three-source intraday pipeline.- Other docs still describe earlier phases such as:
- 2-week bar limits
- OptionMetrics-only workflows
- old working directories under
wrds-data - older notions of what is still unresolved
- Why it matters:
- Operational decisions can be made from outdated assumptions.
- Recommended fix:
- Either update these docs to match the current pipeline or explicitly mark them historical.
- Severity: Low
- Area: docs
- Files:
dividend_derivatives/NOTES.mdequity_options/notes.mdequity_options/HANDOFF_OM_MINUTE_BARS.md
- Problem:
- Several docs still refer to the old repo name and paths from before the reorganization.
- Why it matters:
- This increases confusion when resuming work on the datafeed machine.
- Recommended fix:
- Normalize documentation to the current repo path and directory structure.
- Severity: Low
- Area: repo organization
- Source:
- Claude session logs in
/home/datafeed/.claude/projects/-home-datafeed-market-data-library-lseg-data-fetch
- Claude session logs in
- Problem:
- The session history shows deliberate work to fix imports and hardcoded paths after moving from
wrds-datatomarket data library. - Some of those fixes landed in active scripts, but not all historical helpers and docs were updated.
- The session history shows deliberate work to fix imports and hardcoded paths after moving from
- Why it matters:
- The repo looks more fully migrated than it actually is.
- Recommended fix:
- Do one final migration sweep specifically for path assumptions and stale references.
- Patch equity-options resume logic so corrected
query_ricvalues rerun automatically. - Add a zero-bar recheck workflow for prior legacy logs.
- Patch the bond master overflow logic.
- Remove remaining old absolute paths in gap-RIC helpers.
- Clean up stale docs and clarify which scripts are active vs historical.
- Add focused unit tests around resume-state interpretation and contract status handling.
- The most important remaining equity-options issue is no longer token handling or status logging. It is resume correctness when
query_ricchanges, plus a clean recheck path for legacy zero-bar contracts. - New intraday logs are materially safer than the old ones, but historical zero-bar outcomes still need review before being trusted.