Skip to content

Fix DataPreflight: SPY lives in macro library, not universe#32

Merged
cipher813 merged 1 commit into
mainfrom
fix/preflight-spy-in-macro-lib
Apr 14, 2026
Merged

Fix DataPreflight: SPY lives in macro library, not universe#32
cipher813 merged 1 commit into
mainfrom
fix/preflight-spy-in-macro-lib

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

The daily-mode preflight was checking ArcticDB `universe/SPY` freshness, but SPY (and other market-wide series) lives in the `macro` library. Caught by the first real run on EC2:

```
RuntimeError: Pre-flight: ArcticDB universe/SPY read failed:
E_NO_SUCH_VERSION ... version matching query 'latest' not found for symbol 'SPY'
```

One-line fix: `"universe"` → `"macro"`. The primitive already takes library+symbol as args.

Why macro/SPY is sufficient

`daily_append` writes to both the `universe` (per-stock OHLCV + features) and `macro` (market-wide series) libraries in the same run. If daily_append fails, neither library gets today's row. Checking one library is enough signal.

If we later want asymmetric coverage (macro write succeeds but universe doesn't, or vice versa), we can add a second `check_arcticdb_fresh` call pointed at a universe ticker like AAPL. Not needed for the bug we were actually trying to catch.

Test plan

  • pytest 41/41 pass (no test added — DataPreflight isn't unit-tested at the consumer level; lib tests already cover the primitive)
  • EC2 re-run: `ae-dashboard "... python weekly_collector.py --daily --dry-run ..."` — preflight should now pass and subsequent steps execute

🤖 Generated with Claude Code

The daily-mode preflight was checking ArcticDB `universe/SPY` freshness,
but SPY (and other market-wide series — VIX, sector ETFs, yields) lives
in the `macro` library. The `universe` library holds per-stock OHLCV
for S&P 500/400 constituents.

Caught by the first real run on EC2 dashboard:

  RuntimeError: Pre-flight: ArcticDB universe/SPY read failed:
  E_NO_SUCH_VERSION ... version matching query 'latest' not found
  for symbol 'SPY'

daily_append writes to both libraries in the same run, so checking
macro/SPY freshness is a sufficient signal for the write path being
healthy end-to-end. If we later want asymmetric coverage (macro dies
but universe keeps writing, or vice versa), we can add a second
check_arcticdb_fresh call pointed at a universe ticker like AAPL.

No lib change needed — the primitive already takes library+symbol as
args.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 39359b7 into main Apr 14, 2026
1 check passed
@cipher813 cipher813 deleted the fix/preflight-spy-in-macro-lib branch April 14, 2026 17:08
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