Skip to content

feat(wave3): PR3-wave-2 predictor reader migrations — runner + dead-constant + sector_map#182

Merged
cipher813 merged 1 commit into
mainfrom
feat/wave3-pr3-wave2-predictor-readers
May 20, 2026
Merged

feat(wave3): PR3-wave-2 predictor reader migrations — runner + dead-constant + sector_map#182
cipher813 merged 1 commit into
mainfrom
feat/wave3-pr3-wave2-predictor-readers

Conversation

@cipher813
Copy link
Copy Markdown
Owner

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_KEY

git grep PRICE_CACHE_KEY returned zero references outside the constant itself. Deleting it prevents a future from config import PRICE_CACHE_KEY that 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_s3

Per-ticker parquet lookup now iterates a per-callsite read-prefix chain (reference/predictor/). Inlines the same shape #181 used in regime/features._read_parquet_close rather than importing it — keeps analysis tools decoupled from Lambda-deployed modules.

3. 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.jsonpredictor/price_cache/sector_map.json). sector_map.json now lives at three keys post alpha-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:

  • Price-cache 3-test discipline: prefers-new / falls-back-legacy / absent-in-both
  • sector_map 3-test discipline: prefers-reference / cascades-through-data-then-predictor / returns-empty-on-total-miss
  • PRICE_CACHE_KEY deletion guard

Suite: 1113 → 1120 green (+7).

Discovery surfaced during the audit

scripts/momentum_ic_study_21d.py is named in the L1401 PR3-wave-2 plan as a Wave-3 reader site. git status + git check-ignore confirm 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 as alpha-engine-data#273's list_price_cache_keys, and the hardcoded SECTOR_MAP_KEY constant 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.json only (or a 2-key chain pending data/ retirement timing).

Composes with

🤖 Generated with Claude Code

…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>
@cipher813 cipher813 merged commit 412a679 into main May 20, 2026
1 check passed
@cipher813 cipher813 deleted the feat/wave3-pr3-wave2-predictor-readers branch May 20, 2026 00:23
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