Skip to content

Commit 907df40

Browse files
committed
Prioritize dashboard refresh before daily model tuning
1 parent 24f9ab2 commit 907df40

5 files changed

Lines changed: 28 additions & 22 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,15 @@ boundary, static-site publication, validation gate, and one-time repository conf
258258

259259
The daily command first refreshes the latest prior Ridge and XGBoost portfolios against the
260260
completed session. Yahoo's final hourly bar begins at 15:30, so the command requires that bar and
261-
retries five times at 60-second intervals if it is not available yet. It then requires an official
262-
daily price row for the decision date, independently tunes and refits Ridge and XGBoost, saves both
263-
new top-40 portfolios, writes `selection_stability_YYYY-MM-DD.json`, and rebuilds the shared
264-
dashboard. The stability report tracks same-day model overlap, day-over-day retention, top-10
265-
persistence, rank correlation, entrants/exits, implied replacement, and multi-day consensus names.
266-
This ordering prevents a successful model retrain from leaving the performance chart stuck at an
267-
earlier intraday bar.
261+
retries five times at 60-second intervals if it is not available yet. It evaluates the frozen
262+
portfolios and refreshes both dashboard outputs before the longer tuning stage begins. It then
263+
requires an official daily price row for the decision date, independently tunes and refits Ridge
264+
and XGBoost, saves both new top-40 portfolios, writes
265+
`selection_stability_YYYY-MM-DD.json`, and refreshes both dashboards again. The stability report
266+
tracks same-day model overlap, day-over-day retention, top-10 persistence, rank correlation,
267+
entrants/exits, implied replacement, and multi-day consensus names. This ordering makes the
268+
completed-session result available promptly and prevents a model retrain from leaving the
269+
performance chart stuck at an earlier intraday bar.
268270

269271
The July 20, 2026 production-style run requested 25 Optuna trials with a 600-second timeout. Ten
270272
trials completed, using three 42-session validation folds separated from training by a one-session

docs/LIVE_FORWARD_MONITOR.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ python -m src.cli run-live-forward-daily --as-of YYYY-MM-DD
1818

1919
The command performs these steps in order:
2020

21-
1. Incrementally refreshes market data and evaluates portfolios frozen before the current session,
22-
including one holding-level return record per selected stock.
23-
2. Waits for the final 15:30 hourly bar and verifies the official daily close is available.
24-
3. Rebuilds price features through the decision date.
25-
4. Builds forward-return training labels only where the future outcome was already known before the
21+
1. Waits for the final 15:30 hourly bar and verifies the official daily close is available.
22+
2. Evaluates portfolios frozen before the current session, including one holding-level return
23+
record per selected stock.
24+
3. Immediately rebuilds the local dashboard and sanitized `site/` bundle before model tuning starts.
25+
4. Incrementally refreshes daily market data and rebuilds price features through the decision date.
26+
5. Builds forward-return training labels only where the future outcome was already known before the
2627
decision date.
27-
5. Tunes Ridge and XGBoost independently on temporal validation data, refits the selected
28+
6. Tunes Ridge and XGBoost independently on temporal validation data, refits the selected
2829
configurations, and freezes both top-40 lists for the next evaluation session.
29-
6. Writes model-agreement and day-over-day selection-stability diagnostics.
30-
7. Rebuilds `reports/live_forward/dashboard.html`.
31-
8. Publishes and validates the sanitized static bundle under `site/` for GitHub Pages.
30+
7. Writes model-agreement and day-over-day selection-stability diagnostics.
31+
8. Rebuilds both dashboard outputs again so they include the newly frozen pending portfolios.
3232

3333
If final market data is unavailable, the command retries and then fails closed. It must not create a
3434
snapshot from a partial trading day.

site/data/dashboard.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

site/data/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"schema_version": 1,
3-
"generated_at_utc": "2026-07-23T20:15:48.055630+00:00",
4-
"latest_decision_date": "2026-07-22",
5-
"snapshot_count": 7,
3+
"generated_at_utc": "2026-07-23T21:19:53.915157+00:00",
4+
"latest_decision_date": "2026-07-23",
5+
"snapshot_count": 9,
66
"evaluation_count": 7,
7-
"dashboard_sha256": "6f483ca0e1b74cd15f32937ab633ee07000515295346e474b295cd2817bf2b9a",
8-
"dashboard_bytes": 136241,
7+
"dashboard_sha256": "7452a2fc9de30ea073ee22aeaf1faf8869dc4d8f5c182bb278fd6535397a75cb",
8+
"dashboard_bytes": 152971,
99
"source_policy": "sanitized_live_forward_outputs_only"
1010
}

src/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,8 @@ def run_live_forward_daily_command(
14461446
)
14471447
for snapshot in prior
14481448
]
1449+
pretraining_dashboard = build_live_dashboard(root)
1450+
pretraining_public_site = publish_live_dashboard(root, public_site_dir)
14491451

14501452
cfg = load_config("configs/base.yaml", "configs/data.yaml")
14511453
common = {
@@ -1486,6 +1488,8 @@ def run_live_forward_daily_command(
14861488
"refreshed_prior_snapshots": [str(path) for path in prior],
14871489
"close_reports": close_reports,
14881490
"close_evaluations": close_evaluations,
1491+
"pretraining_dashboard": pretraining_dashboard["dashboard"],
1492+
"pretraining_public_site": pretraining_public_site["output_dir"],
14891493
"ridge_output": ridge["output"],
14901494
"xgb_output": xgb["output"],
14911495
"selection_stability": stability["output"],

0 commit comments

Comments
 (0)