refactor(arcticdb): delegate _open_*_library to lib chokepoint (L2771 part 1/5)#225
Merged
Merged
Conversation
`executor/price_cache.py::_open_universe_library` + `_open_macro_library`
now delegate to `alpha_engine_lib.arcticdb.open_universe_lib` /
`open_macro_lib` — the lib chokepoint that centralizes S3 URI
construction + `get_library` error wrapping across all alpha-engine
ArcticDB consumers (data + predictor + executor + research + backtester).
Local wrappers retained (not deleted) for two reasons:
1. Existing callers (`load_price_histories`, `load_atr_14_pct`, etc.)
keep their import surface unchanged.
2. The module-top `import arcticdb as _arcticdb` (line 23) preserves the
macOS allocator-prime invariant — pyarrow's allocator must NOT load
before arcticdb's bundled aws-c-common allocator, else
`aws_fatal_assert` segfaults on first `get_library()`. Lazy import
inside the lib helper would defeat that ordering if the wrapper here
were deleted entirely.
ROADMAP: **L2771** — _Migrate 6 ArcticDB get_library("universe") sites
to alpha_engine_lib.arcticdb_. First of 5 repos (executor); ae-data +
ae-predictor + ae-research + ae-backtester follow in sibling PRs.
Composes with PR #224 (L1346 c SPY-special-case retirement, OPEN) —
both edit `price_cache.py`; textual conflict is trivial.
Suite: 1021 passed (no regression).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Thin out
executor/price_cache.py::_open_universe_library+_open_macro_libraryto delegate to the existingalpha_engine_lib.arcticdb.open_universe_lib/open_macro_libchokepoint.Local wrappers are RETAINED (not deleted) to keep two invariants intact:
load_price_histories,load_atr_14_pct,eod_reconcile.run, etc.).import arcticdb as _arcticdb(line 23) keeps the macOS allocator-prime ordering — pyarrow must not load before arcticdb's bundledaws-c-common, elseaws_fatal_assertsegfaults on firstget_library().Both wrappers now contain a single
from alpha_engine_lib.arcticdb import open_universe_lib+ delegation call.Why
ROADMAP L2771 — lift the duplicated
adb.Arctic(uri).get_library(...)boilerplate to the lib chokepoint that already exists since v0.1.4. The 2026-04-21 SNDK incident was an escape-bug in a hand-built S3 URI string; centralizing the URI construction prevents that bug class structurally.This is part 1 of 5 — sibling PRs follow in ae-data + ae-predictor + ae-research + ae-backtester.
Composes with
price_cache.py. Textual merge conflict will be trivial (different sections).Test plan
1021 passed🤖 Generated with Claude Code