refactor(spy-universe): retire _MACRO_SYMBOLS SPY-special-cases (L1346 c)#224
Merged
Merged
Conversation
…6 c)
Remove the L1346 transitional carve-out + defensive macro.SPY fallbacks
across the executor. SPY now reads from the `universe` ArcticDB library
like any other held ticker — alpha-engine-data #245 (MERGED 2026-05-15)
lifted SPY to a full `universe` member via `_UNIVERSE_EXTRA =
frozenset({"SPY"})` written by both backfill (Saturday) and daily_append
(weekday). The transitional carve-out served its soak (Sat 5/16 + Mon
5/18 + Sat 5/24 DataPhase1 all wrote universe.SPY cleanly); the path
is now dead defense.
Changes:
- `executor/price_cache.py`: drop SPY from `_MACRO_SYMBOLS` (the constant
becomes "executor's macro-routing list" rather than "everything in
macro lib"; SPY is dual-written there but the executor reads from
universe). Delete the `_MACRO_SYMBOLS_NO_OHLCV = _MACRO_SYMBOLS - {"SPY"}`
derivation and the SPY-specific defensive fallback in `load_price_histories`.
- `executor/eod_reconcile.py`: drop the same `_NO_OHLCV` derivation +
defensive fallback from the held-position close-lookup loop. Branch
directly on `_MACRO_SYMBOLS` membership.
- `executor/main.py`: drop the `_NO_OHLCV` derivation; the ATR-tickers
subtract uses `_MACRO_SYMBOLS` directly.
Tests:
- `test_l1346_spy_atr_exclusion_retired.py`: rewritten to pin the
structural post-retirement state:
- SPY NOT in `_MACRO_SYMBOLS`
- main.py subtracts `_MACRO_SYMBOLS` directly (no `_NO_OHLCV` form)
- `_MACRO_SYMBOLS_NO_OHLCV` symbol does not appear in main.py at all
- No `if ticker == "SPY" and lib is universe(_lib)` fallback in
price_cache OR eod_reconcile
- `test_executor_run_precompute_kwargs.py::test_main_imports_macro_symbols_from_price_cache`:
flipped from `assert "SPY" in _MACRO_SYMBOLS` to `assert "SPY" not in
_MACRO_SYMBOLS` + sanity-check VIX/TNX/IRX/XLK/XLF still present.
Composes with the sibling predictor PR (alpha-engine-predictor, L1346 b)
which dropped the symmetric `macro_lib` fallback from
`_verify_arctic_fresh`. Both PRs are independently mergeable.
Closes L1346 (c) — SPY → universe ArcticDB consumer retirement,
executor half.
Suite: 1023 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
cipher813
added a commit
that referenced
this pull request
May 28, 2026
#225) `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
_MACRO_SYMBOLSinexecutor/price_cache.py— SPY now reads fromuniverselike any other held ticker._MACRO_SYMBOLS_NO_OHLCV = _MACRO_SYMBOLS - {\"SPY\"}carve-out + SPY-specific defensive macro-fallback blocks in 3 files (price_cache.py,eod_reconcile.py,main.py)._MACRO_SYMBOLS, no_NO_OHLCVderivation, no SPY-specific fallback).Why
alpha-engine-data #245 (MERGED 2026-05-15) lifted SPY to a full
universeArcticDB member via_UNIVERSE_EXTRA = frozenset({\"SPY\"}). The transitional executor-side carve-outs preserved backwards-compat during the cross-repo soak; after Sat 5/16 + Mon 5/18 + Sat 5/24 DataPhase1 all wrote universe.SPY cleanly, the carve-outs are dead defense. Perfeedback_no_silent_fails: defensive macro fallback would mask any universe.SPY gap rather than failing loud.ROADMAP: L1886 (c) — SPY → universe ArcticDB consumer retirement, executor half.
Composes with
macro_libfallback from_verify_arctic_fresh. Both PRs are independently mergeable; together they close the L1346 SPY-universe arc.Test plan
1023 passedexecutor/main.py --dry-rungate passes (pre-push hook)load_atr_14_pctreads universe.SPY_MACRO_SYMBOLS(SPY excluded), reads SPY from universe_lib🤖 Generated with Claude Code