PR4 (data, DRAFT): delete slim writer + load_slim_cache API + fallbacks [merge-gated 5/23]#269
Merged
Merged
Conversation
3 tasks
cipher813
added a commit
that referenced
this pull request
May 25, 2026
…sion — close 5/23-SF P0 (m) (#305) L1718 / 5/23-SF P0 (m) operator decision 2026-05-24: relax parity epsilon to cent-scale + un-draft + merge L1718 PR4 drafts (Path B), rather than reconcile slim to universe's adjustment policy (Path A). Root cause (diagnosed earlier this session): ArcticDB universe writes auto-adjusted close (yfinance auto-adjust applied post-dividend); slim cache writes raw close. The 5.36 max_abs_value_delta on EQIX Close 2026-04-29 is dividend-scale (EQIX is a REIT with $5+ quarterly dividends), NOT float-precision. The default 1e-6 epsilon was calibrated for float-precision comparison; it's the wrong scale for adjustment-policy-divergent stores. Path B rationale (institutional per [[feedback_lift_invariants_to_chokepoint_after_second_recurrence]] + [[feedback_sota_institutional_default_no_shortcuts]]): slim cache is on the chopping block by design (L1718 PR4's terminal goal — delete slim writer entirely). Reconciling a doomed store to a single-source- of-truth policy that already exists in universe is throwaway work. The institutional question is "what's the eventual canonical store?" → universe ArcticDB. Path B advances that endgame; Path A delays it. Two caller sites both relaxed identically: - collectors/macro.py L83-90 (breadth parity) - features/compute.py L408-415 (compute parity) Each carries an inline rationale block referencing the (m) operator decision so a future audit doesn't read epsilon=1e-2 as a hidden bandaid. Post-merge consequence: WAVE4_PARITY_METRIC `passed: true` resumes on next Saturday DataPhase1 (5/30); L1718 PR4 drafts (data #269 + backtester #227) become un-draftable; merging PR4 retires slim and makes BOTH reconcile blocks dead code. Full data suite 1471 pass. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lbacks PR4 (data) of the predictor/price_cache_slim deletion arc — TERMINAL state. Staged as DRAFT: the slim writer must keep running through the 5/23 Saturday-SF so the WAVE4_PARITY_METRIC streams emit; merge is gated on that parity read (see WAVE4_SLIM_DELETION_RUNBOOK.md). Code removed: - collectors/slim_cache.py (the 2y-slice writer) — deleted. - weekly_collector.py — slim_cache import + the '# 3. Slim cache' collect block + the --only 'slim' choice + docstrings. - store/parquet_loader.py — load_slim_cache + SLIM_CACHE_PREFIX + now-unused ThreadPoolExecutor import. load_parquet_from_s3 KEPT (re-exported via features.compute._load_parquet_from_s3, consumed by builders/backfill.py — caught by the suite, not the within-file grep). - collectors/macro._load_breadth_prices — ArcticDB-only (slim fallback + parity dual-read removed); preserves the no-null breadth contract (None -> key omitted) on ArcticDB failure, matching pre-Wave-4 single-source-unavailable behaviour. - features/compute._load_price_source — ArcticDB-only (universe + macro libs); slim fallback + parity removed; no-data contract preserved. Tests reworked to the ArcticDB-only terminal state; the PR0b parity-harness/consumer-lock file is repurposed into a permanent regression guard (slim functional surface must never return — lib's own test_reconcile/test_arcticdb still cover the substrate). Full data suite 1375 passing. Added WAVE4_SLIM_DELETION_RUNBOOK.md — the gated, manual S3 prefix deletion (byte-equal backup -> aws s3 rm, Wave-5 precedent). NOT executed by CI or this PR. DRAFT until 2026-05-23 Saturday-SF parity confirms slim<->ArcticDB equivalence across breadth/compute/exit_timing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lusion fix - WAVE4_SLIM_DELETION_RUNBOOK.md Gate #2 rewritten: the original "≥1 clean Saturday-SF parity observation" was made unreachable by the by-design adjustment-policy mismatch (slim raw close vs ArcticDB auto-adjusted close), and the `passed` flag in alpha_engine_lib/reconcile.py:62-68 requires `n_cells_over_epsilon == 0` which dividend-scale deltas cannot satisfy at any reasonable epsilon (even data #305's 1e-2). The actual safety case is 6 weeks of consumer-side ArcticDB-primary production soak since the 2026-04-14 cutover with no correctness alerts. Backup-prefix date bumped 260523 → 260525. - tests/test_wave4_slim_arctic_parity.py: `_production_py_files()` was rglob'ing the entire repo including .venv/, build/, dist/, .git/. Hit on .venv joblib test fixture (big5-encoded) → UnicodeDecodeError before any actual production-code scan could run. Added _EXCLUDED_PREFIXES tuple. Suite 1484 passing post-fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5c46bf7 to
512ed0c
Compare
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.
Terminal PR of the Wave-4
predictor/price_cache_slim/deletion arc (data side).Status (revised 2026-05-25)
Original framing (when opened 2026-05-19): merge-gated on a 5/23 Saturday-SF
WAVE4_PARITY_METRIC passed: trueread across thebreadth+compute+exit_timingstreams.Why that gate is the wrong question. The remaining slim ↔ ArcticDB divergence (5/24 SSM log:
max_abs_value_delta: 5.36on EQIX Close 2026-04-29, 12,105 cells over 1e-6 epsilon) is by-design adjustment-policy mismatch, not a defect signal: ArcticDB universe writes auto-adjusted close (yfinance default), slim writes raw close. Both are correct representations; neither is "the" answer. EQIX is a REIT with $5+ quarterly dividends — over the comparison window the cumulative dividend adjustment IS the delta. Even after data #305 relaxed epsilon to 1e-2,passedis gated onn_cells_over_epsilon == 0(alpha_engine_lib/reconcile.py:62-68); since dividend-scale deltas remain > $0.01, epsilon alone cannot flip the gate.The actual safety case is stronger than the gate could ever provide:
aws s3 rm --recursiveper the runbook, and that's separately gated by a byte-equal S3 backup (Wave-5 precedent).predictor/price_cache/, not source data — regenerable from full cache or ArcticDB at any time.Code removed
collectors/slim_cache.py— the 2y-slice writer — deleted.weekly_collector.py— slim import +# 3. Slim cachecollect block +--only slimchoice + docstrings.store/parquet_loader.py—load_slim_cache+SLIM_CACHE_PREFIX+ now-unusedThreadPoolExecutor.load_parquet_from_s3kept — it's re-exported viafeatures.compute._load_parquet_from_s3and consumed bybuilders/backfill.py.collectors/macro._load_breadth_prices→ ArcticDB-only. No-null breadth contract preserved (None → key omitted) on ArcticDB failure.features/compute._load_price_source→ ArcticDB-only (universe + macro libs). No-data contract preserved.Tests
test_macro_breadth/test_compute_price_sourcereworked to the ArcticDB-only terminal state (slim-fallback/parity tests retired).test_wave4_slim_arctic_parity.pyrepurposed from migration scaffolding into a permanent regression guard: the functional slim surface (writer/loader def, call, or import) must never return.Runbook (not executed by this PR)
WAVE4_SLIM_DELETION_RUNBOOK.md— the gated, manual S3 prefix deletion: pre-deletion byte-equal backup (Wave-5 precedent) →aws s3 rm→ verify-empty.Companion PR
alpha-engine-backtester#227 — removes the slim leg fromexit_timing._load_price_cache+ the verified-deadspot_backtest.shslim sync. Merge after data #269 + Lambda canary green.🤖 Generated with Claude Code