Closes jepa-fx-risk#11 Phase A.
- scripts/autoresearch_start.py: scaffold runs/<rq-id>/ from Council backlog leaf;
fail-closed on non-autoresearch-ready; strips candidate_metric; writes program.md
+ run.json (provenance) + train.py copy. 19 TDD tests.
- loop.py: --run-dir flag redirects STATUS.md / metrics.json / HEARTBEAT / train.py
into the run dir; METRICS_OUT env var passed to train subprocess so it writes
metrics.json to the run dir; heartbeat file written each iter phase; ntfy-on-crash
via NTFY_URL env var (best-effort).
- train.py: METRICS_OUT env var overrides metrics.json path (default unchanged).
Launch: LITELLM_KEY=xxx python loop.py --run-dir runs/rq-04
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two-phase phase-1:
1a. Frozen warmup: head trains on pre-computed embeddings for PHASE1_EPOCHS=200
1b. Joint fine-tune: encoder + head for PHASE1_JOINT_EPOCHS=30 at PHASE1_ENCODER_LR=3e-6
Key design decisions:
- Warm start prevents catastrophic forgetting (PHASE1_JOINT=1 cold-start → -32 R²)
- Normalize live encoder output with FROZEN stats (mu_e/sd_e) so head sees same
embedding distribution it was warmed up on
- head LR reduced 10× in joint phase to prevent head from racing ahead
HPO sweep: 30ep@3e-6=0.3962, 30ep@1e-5=0.3930, 50ep@3e-6=0.3923
Baseline (frozen): 0.3908. New best: phase1_r2=0.3962 (+0.0054 OOS).
New knobs: JEPA_PHASE1_JOINT (default 1), JEPA_PHASE1_JOINT_EPOCHS (default 30),
JEPA_PHASE1_ENCODER_LR (default 3e-6). 4 new tests (tests 15-18). 28/28 pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- prepare_hourly.py: keep O/H/L columns from M1 zips; compute per-hour
hl_range=log(H/L) and ret_intrabar=log(close/open); backward-compat
(falls back to 4-col output only when O/H/L present in input)
- train.py build(): auto-detect extra features from parquet columns
(FEAT_COLS = [ret, realized_vol] + [hl_range, ret_intrabar] if present)
- 5 new tests (9 total in test_prepare_hourly); 24/24 pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- train.py knobs all readable from JEPA_* env vars (JEPA_WINDOW, JEPA_D_MODEL,
JEPA_DEPTH, etc.) so hpo_sweep.py can override without touching source
- scripts/hpo_sweep.py: 3×2×3 grid over D_MODEL × DEPTH × WINDOW,
logs to results/hpo/hpo_results.jsonl with leaderboard at end
- 3 new tests: env override correctness, configs() schema validation
- 19/19 tests pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>