Skip to content

refactor(arcticdb): delegate _open_*_library to lib chokepoint (L2771 part 1/5)#225

Merged
cipher813 merged 2 commits into
mainfrom
refactor/arcticdb-chokepoint-l2771
May 28, 2026
Merged

refactor(arcticdb): delegate _open_*_library to lib chokepoint (L2771 part 1/5)#225
cipher813 merged 2 commits into
mainfrom
refactor/arcticdb-chokepoint-l2771

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

Thin out executor/price_cache.py::_open_universe_library + _open_macro_library to delegate to the existing alpha_engine_lib.arcticdb.open_universe_lib / open_macro_lib chokepoint.

Local wrappers are RETAINED (not deleted) to keep two invariants intact:

  1. Existing callers' import surface unchanged (load_price_histories, load_atr_14_pct, eod_reconcile.run, etc.).
  2. Module-top import arcticdb as _arcticdb (line 23) keeps the macOS allocator-prime ordering — pyarrow must not load before arcticdb's bundled aws-c-common, else aws_fatal_assert segfaults on first get_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

Test plan

  • Full suite green: 1021 passed
  • Sibling PRs in 4 other repos to fully close L2771

🤖 Generated with Claude Code

cipher813 and others added 2 commits May 28, 2026 08:30
`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>
@cipher813 cipher813 merged commit 9d4eb12 into main May 28, 2026
1 check passed
@cipher813 cipher813 deleted the refactor/arcticdb-chokepoint-l2771 branch May 28, 2026 15:53
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