Skip to content

Docs hygiene, uv.lock, test coverage, and Norgate producer reliability#28

Merged
mspinola merged 4 commits into
mainfrom
fix/docs-hygiene-reliability
Jul 20, 2026
Merged

Docs hygiene, uv.lock, test coverage, and Norgate producer reliability#28
mspinola merged 4 commits into
mainfrom
fix/docs-hygiene-reliability

Conversation

@mspinola

Copy link
Copy Markdown
Owner

Batch of maintenance improvements surfaced during a repo review. Four independent commits.

📝 docs: fix dangling doc refs + backfill CHANGELOG

📦 chore: commit uv.lock

Was neither tracked nor ignored (perpetual untracked noise). README promotes the uv workflow, so track it for reproducible installs. Verified with uv lock --check.

✅ test: cover the dormant databento provider and COT read API

  • test_databento_provider.py — the largest provider (280 LOC) had zero tests. Smoke tests mock the SDK (optional extra) and lock the hard-won statistics logic: Open Interest (stat_type 9) and settlement (stat_type 3) overriding Close dated by ts_ref.
  • test_cot.pyget_cot report dispatch, symbol/CFTC-code lookup, and predecessor-code stitching (scale numeric cols, re-stamp code, keep primary on overlaps, sort).

🛠 fix(prices): Norgate producer reliability

  1. Fail fast on NDU outage. norgatedata retries each call 10× then calls bare sys.exit() — which exits 0 (a scheduled --prices run looks "successful" while writing nothing and never retries) and raises SystemExit past the per-symbol handler (kills the run on symbol Norgate integration: cotdata data layer (Norgate prices, CFTC ETL, Databento dormant, code-stitching) #1). The producer now probes norgatedata.status() (a safe, non-exiting check) first and raises a clear RuntimeError → non-zero exit if NDU is down.
  2. Never persist all-null spec rows. get_symbol_metadata catches each field error to None, so a transient Norgate failure on a covered symbol wrote an all-null row (and on a scoped upsert would overwrite good specs with nulls). Such rows are now skipped with a warning.

Tests

Full suite: 81 passed (was 70; +11). No behavior change to existing green paths — existing Norgate tests just stub the new status() preflight.

🤖 Generated with Claude Code

mspinola and others added 4 commits July 20, 2026 12:24
The docs/plan_promote_reconstructed_volume.md spec was removed in #15 but was
still referenced from config.py, store.py (a user-facing RuntimeError), and
README.md — each a dead pointer. Drop the references; the surrounding text and
the README reconstructed-volume section already explain the schema-v2 behavior.

Backfill the Unreleased CHANGELOG, which had only #23: add the Yahoo provider +
MSCI held-out markets (#24), fold #26 into the propadj entry, and record the
metadata-upsert (#25) and Yahoo-only-skip (#27) fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
uv.lock was neither tracked nor ignored, so it perpetually showed as untracked.
The README promotes the uv workflow (`uv pip install -e .`), so track the lock
for reproducible resolution. Verified current with `uv lock --check`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The largest provider (databento, 280 LOC) had no tests and cot.py's consumer
read path was untested. Add:

- test_databento_provider.py — smoke tests mocking the databento SDK (an optional
  extra) that lock the hard-won statistics parsing: Open Interest from stat_type 9,
  and settlement (stat_type 3) overriding Close dated by ts_ref.
- test_cot.py — get_cot report dispatch, symbol/CFTC-code lookup, and the
  predecessor-code stitching (scale numeric cols, re-stamp code, keep primary on
  overlapping dates, sort).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two producer reliability fixes for the Norgate path.

1. Preflight NDU reachability. norgatedata retries each data call 10x then calls
   bare sys.exit() — which exits 0 (a scheduled --prices run looks "successful"
   while writing nothing and never triggers scheduler retry) and raises SystemExit
   past the per-symbol `except Exception`, killing the run on the first symbol.
   update()/update_metadata() now probe norgatedata.status() (a safe, non-exiting
   check) first and raise a clear RuntimeError → non-zero exit if NDU is down.

2. Guard all-null metadata rows. get_symbol_metadata catches each field error to
   None, so a transient Norgate failure on a covered symbol wrote an all-null spec
   row (and on a scoped upsert would overwrite good specs with nulls). Skip such
   rows with a warning.

Tests: preflight aborts update()/update_metadata() when status() is False; the
all-null row is skipped on a full run. Full suite 81 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mspinola
mspinola merged commit d7712fb into main Jul 20, 2026
5 checks passed
@mspinola
mspinola deleted the fix/docs-hygiene-reliability branch July 20, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant