Skip to content

feat(executor): retire SPY from #185 ATR exclusion — close L1346 (c) first half#207

Merged
cipher813 merged 1 commit into
mainfrom
feat/l1346-c-retire-spy-atr-exclusion
May 24, 2026
Merged

feat(executor): retire SPY from #185 ATR exclusion — close L1346 (c) first half#207
cipher813 merged 1 commit into
mainfrom
feat/l1346-c-retire-spy-atr-exclusion

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

L1346 (c) executor-side retirement, first half: SPY no longer excluded from the ATR ticker set, since universe.SPY now carries atr_14_pct via alpha-engine-data #245's _UNIVERSE_EXTRA write path.

#185's own comment block anticipated this retirement — "the right remedy for ATR is exclusion (macro lib has no ATR)" is now stale. universe.SPY has full OHLCV + features.

Implementation

  • New _MACRO_SYMBOLS_NO_OHLCV = _MACRO_SYMBOLS - {"SPY"} at the ATR exclusion site
  • VIX/TNX/IRX/sector ETFs still excluded (still Close-only in macro)
  • Updated comment block names the L1346 (c) closure + Gate (a) verification evidence

Test plan

  • 2 new tests in test_l1346_spy_atr_exclusion_retired.py (white-box + source-level pin)
  • Full executor suite 962 pass
  • Next morning-planner run: ATR map includes SPY without NoSuchVersionException

Out of scope (continuing arc)

🤖 Generated with Claude Code

…first half

L1346 (c) — the executor-side retirement of SPY-special-cases that
alpha-engine #185 added as a defensive measure while SPY was only in
macro library (Close-only).

Post-fix evidence: alpha-engine-data #245 (MERGED 2026-05-15) promoted
SPY to a full `universe` ArcticDB member via
`_UNIVERSE_EXTRA = frozenset({"SPY"})`, written by both backfill.py
(Saturday) and daily_append.py (weekday). 2026-05-24 DataPhase1 SSM
log confirms: `Backfill write complete: 904 ok` = 903 constituents +
SPY. universe.SPY now carries the atr_14_pct feature column that
load_atr_14_pct needs.

The #185 comment block itself anticipated this retirement:
"the right remedy for ATR is exclusion (macro lib has no ATR), not
macro-lib dispatch" — that's now stale advice. universe.SPY has full
OHLCV + features; ATR computation works.

Implementation:

- New `_MACRO_SYMBOLS_NO_OHLCV = _MACRO_SYMBOLS - {"SPY"}` constant at
  the ATR exclusion site. Subtracts SPY from the exclusion (because
  universe.SPY now has OHLCV) while preserving the exclusion for VIX,
  TNX, IRX, sector ETFs, etc. (still Close-only in macro lib).
- Comment block updated to reference L1346 (c) closure + the gate (a)
  verification evidence.

Tests: 2 new in `test_l1346_spy_atr_exclusion_retired.py`:
- White-box: SPY not in `_MACRO_SYMBOLS - {"SPY"}` derived set; legacy
  Close-only symbols (VIX/TNX/IRX/XLK/XLF) still in exclusion.
- Source-level pin: `executor/main.py` derivation uses
  `_MACRO_SYMBOLS_NO_OHLCV`, NOT the full `_MACRO_SYMBOLS`. Future
  refactor that drops the subset distinction silently re-introduces
  the bug L1346 (c) closed.

Full executor suite 962 pass.

OUT OF SCOPE — continuing arc:

- `executor/price_cache.py:135` `_MACRO_SYMBOLS` routing flip (read SPY
  from universe first, fall back to macro) — mirrors the predictor
  pattern from alpha-engine-predictor #196 (L1346 (b)). Defer as
  follow-up because price_cache.load_price_histories has more callers
  than the single ATR site here.
- `executor/eod_reconcile.py:655` `_MACRO_SYMBOLS` routing flip — same
  pattern. Defer for the same reason.

Both can ship together as a follow-up PR mirroring the predictor's
defensive macro-fallback shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 7fa05c5 into main May 24, 2026
1 check passed
@cipher813 cipher813 deleted the feat/l1346-c-retire-spy-atr-exclusion branch May 24, 2026 23:54
cipher813 added a commit that referenced this pull request May 25, 2026
…refer universe.SPY with macro fallback (#208)

Completes the L1346 (c) retirement of SPY-special-cases across the
executor. Pre-fix sites used `if ticker in _MACRO_SYMBOLS` to route
SPY reads to macro library (Close-only); post-L1346 #245 universe.SPY
now has full OHLCV via `_UNIVERSE_EXTRA`.

Implementation (mirrors alpha-engine-predictor #196 defensive shape):

- `executor/price_cache.py::load_price_histories` — gates on
  `_MACRO_SYMBOLS_NO_OHLCV = _MACRO_SYMBOLS - {"SPY"}`. SPY routes to
  universe first; on universe-read failure, defensive fallback to
  macro.SPY (clearly logged via dual-exception-class read_errors line).
- `executor/eod_reconcile.py` — same routing flip + defensive fallback.

Non-SPY macro symbols (VIX/TNX/IRX/sector ETFs) remain macro-routed
(still Close-only in macro library; no universe entry).

Defensive fallback can be removed once L1346 (b)+(c) soak clean for
≥1 Saturday cycle (operator-promoted soak; ~1-2 Saturdays out).

Test plan:
- Full executor suite 962 pass.
- Pre-existing alpha-engine #185 ATR exclusion site already updated
  to `_MACRO_SYMBOLS_NO_OHLCV` (PR #207).

Closes ROADMAP L1346 (c) second half. Combined with #207 (first half)
+ #196 (predictor (b) gate), the entire L1346 retirement arc is now
shipped except the operator soak-watch.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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