Skip to content

Commit abd8c3e

Browse files
authored
Merge pull request #9 from HanSun103/archive-live-forward-readme
Refresh live monitor through official closes
2 parents 6c65e2e + 8fc4777 commit abd8c3e

16 files changed

Lines changed: 607 additions & 20 deletions
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Refresh live-forward dashboard
2+
3+
on:
4+
schedule:
5+
# 6:30 PM Toronto during standard time; 5:30 PM during daylight time.
6+
- cron: "30 22 * * 1-5"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: github-pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
refresh:
20+
name: Refresh official closes and deploy
21+
runs-on: ubuntu-latest
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
steps:
26+
- name: Check out the default branch
27+
uses: actions/checkout@v7
28+
with:
29+
ref: ${{ github.event.repository.default_branch }}
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v7
33+
with:
34+
python-version: "3.12"
35+
cache: pip
36+
37+
- name: Install public-refresh dependencies
38+
run: python -m pip install "numpy>=1.26" "pandas>=2.1" "yfinance>=0.2.31"
39+
40+
- name: Refresh sanitized cohort evidence
41+
run: python -m src.experiments.public_cohort_refresh --site-dir site
42+
43+
- name: Validate sanitized public bundle
44+
run: python -m src.experiments.public_dashboard_validation --site-dir site
45+
46+
- name: Commit refreshed public data
47+
shell: bash
48+
run: |
49+
if git diff --quiet -- site/data/dashboard.json site/data/manifest.json; then
50+
echo "The public monitor is already current."
51+
exit 0
52+
fi
53+
git config user.name "github-actions[bot]"
54+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
55+
git add site/data/dashboard.json site/data/manifest.json
56+
git commit -m "Refresh live-forward dashboard"
57+
git push origin HEAD
58+
59+
- name: Configure GitHub Pages
60+
uses: actions/configure-pages@v6
61+
62+
- name: Upload dashboard artifact
63+
uses: actions/upload-pages-artifact@v5
64+
with:
65+
path: site
66+
67+
- name: Deploy dashboard
68+
id: deployment
69+
uses: actions/deploy-pages@v5

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ dashboard, and regenerates the sanitized GitHub Pages bundle:
312312
python -m src.cli run-live-forward-daily --as-of YYYY-MM-DD
313313
```
314314

315+
The public monitor also refreshes automatically at 22:30 UTC on weekdays. The
316+
scheduled job rebuilds the same frozen-cohort paths from sanitized selections,
317+
fails closed on missing prices, validates the bundle, and deploys the refreshed
318+
site. The default Portfolio vs Benchmark chart now follows this monitoring path,
319+
so its latest date advances even though stock selection remains frozen.
320+
315321
The **Holding-period laboratory** can keep any dated list unchanged or compare
316322
custom 1-60-session replacement horizons, including 5/10/20-session presets.
317323
Ridge and XGBoost can be toggled independently while SPY remains permanently

docs/GITHUB_PAGES_DEPLOYMENT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ deploying. After merge, the resulting push to `main` runs the same validation,
7171
uploads the Pages artifact, and deploys it to the `github-pages` environment.
7272
The deploy job is explicitly restricted to `refs/heads/main`.
7373

74+
The scheduled public refresh runs at 22:30 UTC on weekdays, after the regular
75+
US market close. It reconstructs the frozen-cohort monitor from the sanitized
76+
portfolio selections already committed in `site/data/dashboard.json`, downloads
77+
only their adjusted closes and SPY, validates the bundle, commits changed public
78+
JSON, and deploys that exact version. It does not access the ignored `reports/`
79+
directory, model files, news data, API credentials, or local caches. On market
80+
holidays, the refresh detects that the latest official close is already
81+
published and leaves the site unchanged.
82+
83+
The scheduled workflow is
84+
[`refresh-dashboard.yml`](../.github/workflows/refresh-dashboard.yml). It can
85+
also be launched manually from GitHub Actions when a scheduled run needs to be
86+
repeated.
87+
7488
## One-time repository setting
7589

7690
In the GitHub repository, open **Settings > Pages** and set **Source** to **GitHub Actions**. After

docs/LIVE_FORWARD_MONITOR.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ interval. Five-, 10-, and 20-session presets are provided, and the horizon compa
4444
every 1–20-session candidate side by side. SPY is permanent and begins from the same zero-return
4545
decision-close baseline as each portfolio.
4646

47+
The main **Portfolio vs Benchmark** chart uses the archived one-session policy
48+
while frozen-cohort monitoring is active. It therefore extends through every
49+
new official close even though no new stock list is generated after July 27.
50+
The date controls and KPI cards are rebased to the selected monitoring window.
51+
The stock-level table and experiment history remain immutable records of the
52+
original one-session snapshots.
53+
4754
The displayed **replacement turnover** excludes the unavoidable initial purchase. An unchanged
4855
cohort therefore correctly shows 0% replacement turnover. Scheduled policies use the same
4956
$1 million capital, 8 bps one-way cost, $10 fixed trade fee, and 0.25% minimum trade-weight rule.

0 commit comments

Comments
 (0)