Skip to content

Declare marketdata, and document the second store the server now needs - #26

Merged
mspinola merged 2 commits into
mainfrom
claude/adr7-step4-marketdata-dep
Aug 9, 2026
Merged

Declare marketdata, and document the second store the server now needs#26
mspinola merged 2 commits into
mainfrom
claude/adr7-step4-marketdata-dep

Conversation

@mspinola

@mspinola mspinola commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Companion to mspinola/cotmetrics#11, which repoints price reads from cotdata to marketdata under ADR-0007.

Measured: there is nothing here to repoint

The work order lists cot-analyzer as a consumer to repoint. As measured today it has zero get_prices calls and zero import cotdata — its coupling is a declared dependency plus a cotdata-update subprocess in pages/system/admin.py, and that subprocess stays exactly where it is, because COT production did not move.

So the change here is wiring and deployment, not code:

  • pyproject.toml — declare marketdata>=0.1.0 beside cotdata
  • requirements.txt-e ../marketdata, same editable-sibling convention as the other two
  • scripts/check_dep_floors.pymarketdata is an internal sibling and needs the same floor check

The deployment consequence, which is the part worth care

The server now needs MARKETDATA_STORE set and a second synced store. Without it, the price reads behind the indexer, the signal rejection scores and the options max-pain snapshot fail at the point of read.

Positioning and prices come from different packages now, so one store can be healthy while the other is absent. server-side/README.md gains that as a named symptom, because "COT works but prices do not" is not a shape this deployment could previously produce — previously one store meant one failure mode.

Also documented there:

  • Both stores are synced, not produced on that box. It cannot produce bars at any Python version: norgatedata drives a locally installed Norgate Data Updater and NDU is Windows-only.
  • They must stay separate roots. Each package keeps a manifest.json at its own root and does a read-modify-write on it, so merging them would have the producers dropping each other's entries.
  • The rsync section gains the second push.
  • The metrics-cache note is corrected: it busts on both upstream store versions now, and the reason is that the bump it was written for (reconstructed volume) was a price schema bump.

Testing

131 pass, ruff clean over src and tests (what CI lints). The internal dependency floor check passes with all three siblings installed:

cot-analyzer: internal dependency floors OK
  cotdata 0.3.0 satisfies '>=0.1.0'
  marketdata 0.1.0 satisfies '>=0.1.0'
  cotmetrics 0.3.0 satisfies '>=0.3.0'

scripts/max-pain.py has two pre-existing ruff findings; it is untouched here and outside CI's lint path.

Merge order

marketdata must be released or available as an editable sibling before this and cotmetrics#11 land together — the two are a pair, and cotmetrics#11 is the one that actually changes reads.


Generated by Claude Code

mspinola and others added 2 commits August 9, 2026 02:25
cotmetrics reads bars from marketdata as of its ADR-0007 repoint, so this
package needs the dependency declared even though it imports neither: its own
source has no cotdata import and no get_prices call at all. Measured rather
than assumed — the work order lists cot-analyzer as a consumer to repoint, and
there is nothing here to repoint. The coupling is a declared dependency plus a
cotdata-update subprocess, and that subprocess stays where it is because COT
production did not move.

The deployment consequence is the part worth care. The server now needs
MARKETDATA_STORE set and a second synced store, and without it the price reads
behind the indexer, the rejection scores and the max-pain snapshot fail at the
point of read. Positioning and prices come from different packages now, so one
store can be healthy while the other is absent; the troubleshooting section
names that shape directly, because "COT works but prices do not" is not a
symptom this file could previously produce.

Both stores are synced rather than produced there — that box cannot produce
bars at any Python version, norgatedata needing a Windows-only Norgate Data
Updater — and they must stay separate roots, since each package keeps a
manifest.json at its own root and does a read-modify-write on it.

Also corrects the cache note: the metrics cache busts on both upstream store
versions now, and the reason is that the bump it was written for was a price
schema bump.

131 tests pass, ruff clean over what CI lints, and the internal dependency
floor check passes with all three siblings installed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jo4iovRfc2fzE9MwcLp7r2
Every job went red at install. This repo resolves its internal siblings by
checking them out and installing editable, and marketdata has no PyPI release,
so declaring the dependency without adding the checkout makes `pip install -r
requirements.txt` fail before a single test runs.

A dummy MARKETDATA_STORE joins the dummy COTDATA_STORE for the same reason the
first one exists: neither package defaults a missing store root to somewhere
plausible, both raise by name, and there are two roots now.

Worth noting the shape rather than just the fix. The local run passed because
the sibling was already installed in the venv; CI builds the environment from
scratch, which is the only place a missing distribution shows up. That is the
same class as the three defects this port has already produced — a green run
proving something narrower than it appeared to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jo4iovRfc2fzE9MwcLp7r2
@mspinola
mspinola marked this pull request as ready for review August 9, 2026 02:30
@mspinola
mspinola merged commit e285fbe into main Aug 9, 2026
3 checks passed
@mspinola
mspinola deleted the claude/adr7-step4-marketdata-dep branch August 9, 2026 02:32
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