PR2: exit_timing → ArcticDB-primary (slim parity + price_cache fallback)#226
Merged
Conversation
…ache fallback) PR2 of the Wave-4 predictor/price_cache_slim deletion arc — backtester consumer. Consumes lib v0.20.0. analysis/exit_timing._load_price_cache: the traded-ticker price load (equities + SPY from trades.db — all universe members; exit_timing never needs macro/index symbols, so no macro-lib read) moves to lib load_universe_ohlcv as primary. The slim -> price_cache(10y) parquet chain is retained as fallback for any ticker ArcticDB does not return. While slim still exists, dual-read + emit reconcile as_metrics() JSON (grep WAVE4_PARITY_METRIC exit_timing), require_ticker_match=False (some traded tickers may live only in the parquet cache). slim leg removed in PR4; predictor/price_cache (10y) stays — Wave-3 scope. Stale module docstring (line 11) corrected. Lockstep pin bump 0.16.0 -> 0.20.0 across all 4 sites (requirements.txt + lambda_health/concordance/counterfactual Dockerfiles). The separate test_flow_doctor_wiring stable-tag assertion updated per its own 'update if the pin moves' instruction. +3 tests (arctic-primary / parquet-fallback / arctic-failure-caught); full backtester suite 1687 passing. FINDING (not in scope; surfaced not actioned): spot_backtest.sh:528 'aws s3 sync predictor/price_cache_slim/' bootstraps a local cache for the predictor synthetic backtest, but synthetic/predictor_backtest.py's own docstring states its slim fallbacks were removed 2026-04-16 (ArcticDB canonical) — likely DEAD staging (Wave-5 'tested but uncalled' pattern). Left intact pending verification; flagged for a follow-up before PR4. 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.
Backtester consumer of the Wave-4 arc (
predictor/price_cache_slim/deletion). Consumes libv0.20.0(PR0a-2). Builds on PR1a #267 + PR1b #268 (data consumers, merged).Audit result (the open question, answered)
exit_timing._load_price_cache's tickers come fromtrades.db(SELECT e.ticker FROM trades) = traded tickers = equities + SPY, all universe members. exit_timing never needs macro/index symbols → noload_macro_serieshere. Simpler than PR1b.Change
load_universe_ohlcv(bucket, symbols=tickers)is now primary (restricted read — just the traded tickers).predictor/price_cache_slim→predictor/price_cache(10y) per-ticker parquet chain is retained as fallback for any ticker ArcticDB doesn't return.reconcile(...).as_metrics()JSON — grepWAVE4_PARITY_METRIC exit_timing.require_ticker_match=False(some traded tickers may exist only in the parquet cache — set asymmetry logged, not fatal).predictor/price_cache(10y) untouched — that's Wave-3's scope (clean boundary).Safety
0.16.0 → 0.20.0across all 4 sites (requirements.txt+lambda_health/lambda_concordance/lambda_counterfactualDockerfiles —test_lib_pin_lockstepenforced). A second guard,test_flow_doctor_wiring::test_requirements_pins_lib_to_stable_tag, hard-asserts the expected version with an explicit "update this test if the pin moves" instruction — updated accordingly.infrastructure/spot_backtest.sh:528bulk-syncspredictor/price_cache_slim/into a local cache for the predictor synthetic backtest — butsynthetic/predictor_backtest.py's own docstring states its slim fallbacks were removed 2026-04-16 (ArcticDB canonical). This is likely dead staging (the Wave-5 "tested but uncalled" antipattern). Per the reproduce-before-deleting discipline I did not speculatively remove it — left intact, flagged for verification before PR4 (it's a slim reference PR4's cleanup will want gone, but deleting remote-script bootstrap unverified could silently break the SF predictor-backtest stage).Sequence
Next: PR3 (dashboard
health_checker.py— retire the slim freshness check, not migrate). Then PR4: delete writer+prefix + the (verified) dead spot-script sync, gated on one clean Saturday-SF zero-diff across the threeWAVE4_PARITY_METRICstreams (breadth / compute / exit_timing).🤖 Generated with Claude Code