Skip to content

PR2: exit_timing → ArcticDB-primary (slim parity + price_cache fallback)#226

Merged
cipher813 merged 1 commit into
mainfrom
feat/exit-timing-arcticdb
May 19, 2026
Merged

PR2: exit_timing → ArcticDB-primary (slim parity + price_cache fallback)#226
cipher813 merged 1 commit into
mainfrom
feat/exit-timing-arcticdb

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Backtester consumer of the Wave-4 arc (predictor/price_cache_slim/ deletion). Consumes lib v0.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 from trades.db (SELECT e.ticker FROM trades) = traded tickers = equities + SPY, all universe members. exit_timing never needs macro/index symbols → no load_macro_series here. Simpler than PR1b.

Change

  • load_universe_ohlcv(bucket, symbols=tickers) is now primary (restricted read — just the traded tickers).
  • The existing predictor/price_cache_slimpredictor/price_cache(10y) per-ticker parquet chain is retained as fallback for any ticker ArcticDB doesn't return.
  • Parity observation: while slim exists, dual-read slim for the ArcticDB-returned tickers and emit reconcile(...).as_metrics() JSON — grep WAVE4_PARITY_METRIC exit_timing. require_ticker_match=False (some traded tickers may exist only in the parquet cache — set asymmetry logged, not fatal).
  • slim leg removed in PR4; predictor/price_cache (10y) untouched — that's Wave-3's scope (clean boundary).
  • Stale module docstring (line 11, "Reads from predictor/price_cache_slim") corrected.

Safety

  • Lockstep pin 0.16.0 → 0.20.0 across all 4 sites (requirements.txt + lambda_health / lambda_concordance / lambda_counterfactual Dockerfiles — test_lib_pin_lockstep enforced). 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.
  • +3 tests (arctic-primary / parquet-fallback / arctic-failure-caught). Full backtester suite 1687 passing.

⚠️ Finding — surfaced, not actioned (PR0b pattern)

infrastructure/spot_backtest.sh:528 bulk-syncs predictor/price_cache_slim/ into 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). 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.pyretire 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 three WAVE4_PARITY_METRIC streams (breadth / compute / exit_timing).

🤖 Generated with Claude Code

…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>
@cipher813 cipher813 merged commit 3be1b6a into main May 19, 2026
1 check passed
@cipher813 cipher813 deleted the feat/exit-timing-arcticdb branch May 19, 2026 20:33
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