feat(wave3): PR3-wave-2 predictor reader migrations — runner + dead-constant + sector_map#182
Merged
Merged
Conversation
…onstant + sector_map (ROADMAP L1401) Completes the predictor-repo side of Wave-3 PR3 reader migration. The deployed Lambda chokepoint shipped 2026-05-19 via #181 (regime/features ._read_parquet_close); this PR closes the analysis-tool sites the L1401 PR3 follow-up plan flagged + a dead module-level constant. - ``config.PRICE_CACHE_KEY = "predictor/price_cache/{ticker}.parquet"`` deleted. ``git grep PRICE_CACHE_KEY`` returned zero references outside the constant itself — classic dead-code scaffolding. A new regression-pin test ``test_config_no_longer_exports_price_cache_key _constant`` prevents a future ``from config import PRICE_CACHE_KEY`` from silently bypassing the Wave-3 read-prefix chain. - ``analysis/triple_barrier_cutover_runner._load_prices_from_s3`` iterates a per-callsite read-prefix chain (new → legacy) for the per-ticker parquet lookup. Inlines the same shape #181 used in ``regime/features._read_parquet_close`` rather than importing — keeps analysis tools decoupled from Lambda-deployed modules. - ``analysis/triple_barrier_cutover_runner._load_sector_map_from_s3`` prepends ``reference/price_cache/sector_map.json`` to the existing fallback list (data/sector_map.json → predictor/price_cache/sector _map.json). sector_map.json now lives at THREE keys post alpha-engine-data #272's write-both gap fix; the reader prefers the new home but cascades through both legacy locations for the soak. - New test file ``tests/test_triple_barrier_cutover_runner_wave3 _readers.py`` — 7 tests covering: prefers-new, falls-back-legacy, absent-in-both (price-cache 3-test discipline); sector_map prefers- new, cascades-through-data-then-predictor, returns-empty-on-total- miss; PRICE_CACHE_KEY deletion guard. Suite 1113 → 1120 green. Discovery (surfaced + handled in main checkout, NOT in this PR): ``scripts/momentum_ic_study_21d.py`` is named in the L1401 PR3-wave-2 plan but ``git status`` confirms it is **untracked / never committed** — a local-only operator analysis script. Migrated in the main repo working copy so it survives PR4 cutover, but not added to git here. Brian's call whether to git-track it later; the migration is reversible either way. Composes with: alpha-engine-predictor #181 (the deployed Lambda chokepoint this mirrors), alpha-engine-data #272 (sector_map.json 3-key write-both that this reads from), alpha-engine-data #273 (sibling PR3-wave-2 — data-repo invasive sites). 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.
Completes the predictor-repo side of Wave-3 PR3 reader migration (ROADMAP L1401). The deployed Lambda chokepoint shipped 2026-05-19 via #181 (
regime/features._read_parquet_close); this PR closes the analysis-tool sites the L1401 PR3-wave-2 plan flagged + the dead module-level constant.What's in this PR
1. Dead-constant removal —
config.PRICE_CACHE_KEYgit grep PRICE_CACHE_KEYreturned zero references outside the constant itself. Deleting it prevents a futurefrom config import PRICE_CACHE_KEYthat would bypass the Wave-3 read-prefix chain. A regression-pin test (test_config_no_longer_exports_price_cache_key_constant) locks the deletion.2.
analysis/triple_barrier_cutover_runner._load_prices_from_s3Per-ticker parquet lookup now iterates a per-callsite read-prefix chain (
reference/→predictor/). Inlines the same shape #181 used inregime/features._read_parquet_closerather than importing it — keeps analysis tools decoupled from Lambda-deployed modules.3.
analysis/triple_barrier_cutover_runner._load_sector_map_from_s3Prepends
reference/price_cache/sector_map.jsonto the existing fallback list (data/sector_map.json→predictor/price_cache/sector_map.json).sector_map.jsonnow lives at three keys postalpha-engine-data#272's write-both gap fix; this reader prefers the new home but cascades through both legacy locations for the soak.Tests
New file
tests/test_triple_barrier_cutover_runner_wave3_readers.py— 7 tests:Suite: 1113 → 1120 green (+7).
Discovery surfaced during the audit
scripts/momentum_ic_study_21d.pyis named in the L1401 PR3-wave-2 plan as a Wave-3 reader site.git status+git check-ignoreconfirm it is untracked / never committed — a local-only operator analysis script (not gitignored, just not added). I migrated it in the main repo working copy so it survives PR4 cutover, but did NOT add it to git in this PR. Brian's call whether to git-track it later; the migration is reversible either way.The file's
download_price_cache()now iterates the read-prefix chain with the same dedupe-by-basename logic asalpha-engine-data#273'slist_price_cache_keys, and the hardcodedSECTOR_MAP_KEYconstant was dropped (it was unused after the read path through the synced cache directory remained correct).PR4 cutover
Post-soak (earliest ~2026-05-26), PR4 drops the legacy entry from both fallback tuples here in one edit; the sector_map fallback collapses to
reference/price_cache/sector_map.jsononly (or a 2-key chain pending data/ retirement timing).Composes with
[[reference-wave3-read-new-first-with-legacy-fallback-pattern]]🤖 Generated with Claude Code