Skip to content

PR4 (data, DRAFT): delete slim writer + load_slim_cache API + fallbacks [merge-gated 5/23]#269

Merged
cipher813 merged 2 commits into
mainfrom
chore/wave4-delete-slim-tier
May 25, 2026
Merged

PR4 (data, DRAFT): delete slim writer + load_slim_cache API + fallbacks [merge-gated 5/23]#269
cipher813 merged 2 commits into
mainfrom
chore/wave4-delete-slim-tier

Conversation

@cipher813
Copy link
Copy Markdown
Owner

@cipher813 cipher813 commented May 19, 2026

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: true read across the breadth + compute + exit_timing streams.

Why that gate is the wrong question. The remaining slim ↔ ArcticDB divergence (5/24 SSM log: max_abs_value_delta: 5.36 on 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, passed is gated on n_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:

  1. ArcticDB cutover landed 2026-04-14; consumer migrations have been ArcticDB-primary in production since their respective merges (data PR1a: macro breadth → ArcticDB (slim fallback + parity-observed) #267 macro-breadth, data PR1b: feature compute price+macro → ArcticDB (universe+macro libs, slim fallback, parity) #268 feature-compute, backtester feat(news_sources): adapter implementations + aggregator (Wave 1 PR β; requires lib v0.15.0) #226 exit_timing, dashboard fix(ci): grant GHA role full resource CRUD for CF stack updates #88 health-check). 6 weeks of weekly Saturday SF + daily inference + weekly backtest cycles, no correctness alerts.
  2. The institutional question — "should slim go away?" — was decided affirmatively when the ArcticDB cutover landed. The parity gate's job was to verify ArcticDB had equivalent data BEFORE we deleted the writer; the consumer-side soak provides that evidence with more rigor than the cell-equality check.
  3. Merge is reversible. Revert PR restores the writer + fallbacks. The irreversible step is aws s3 rm --recursive per the runbook, and that's separately gated by a byte-equal S3 backup (Wave-5 precedent).
  4. Slim is a 2y slice derived from 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 cache collect block + --only slim choice + docstrings.
  • store/parquet_loader.pyload_slim_cache + SLIM_CACHE_PREFIX + now-unused ThreadPoolExecutor. load_parquet_from_s3 kept — it's re-exported via features.compute._load_parquet_from_s3 and consumed by builders/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_source reworked to the ArcticDB-only terminal state (slim-fallback/parity tests retired).
  • test_wave4_slim_arctic_parity.py repurposed from migration scaffolding into a permanent regression guard: the functional slim surface (writer/loader def, call, or import) must never return.
  • Full data suite passing post-rebase.

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 from exit_timing._load_price_cache + the verified-dead spot_backtest.sh slim sync. Merge after data #269 + Lambda canary green.

🤖 Generated with Claude Code

@cipher813 cipher813 marked this pull request as ready for review May 21, 2026 17:58
@cipher813 cipher813 marked this pull request as draft May 21, 2026 17:59
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>
cipher813 and others added 2 commits May 25, 2026 10:55
…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>
@cipher813 cipher813 force-pushed the chore/wave4-delete-slim-tier branch from 5c46bf7 to 512ed0c Compare May 25, 2026 17:58
@cipher813 cipher813 marked this pull request as ready for review May 25, 2026 18:00
@cipher813 cipher813 merged commit ed71665 into main May 25, 2026
1 check passed
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