Add authenticated global economic calendar with Jin10 fallback
Collect macroeconomic releases, events and holidays through the official browser SDK with resumable history from 2025. Preserve evidence, revisions and observation times, and merge verified series with official fields taking priority. Add category filters, field provenance, coverage and connection status. Verify calendar persistence and deployment recovery in isolated acceptance checks.
This commit is contained in:
1 parent
57424fd661
commit
e840557d22
35 files changed
+6828
-94
No files matched your search
@@ -11,6 +11,8 @@ FROM base AS check
|
||||
RUN uv sync --locked && uv run pytest && uvx ruff==0.14.14 check --select F,E9,B src tests
|
||||
|
||||
FROM base AS runtime
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
|
||||
RUN playwright install --with-deps --only-shell chromium
|
||||
ARG APP_VERSION=source
|
||||
ARG APP_COMMIT=unknown
|
||||
ENV APP_VERSION=$APP_VERSION APP_COMMIT=$APP_COMMIT
|
||||
|
||||
@@ -53,3 +53,15 @@ The additive `c4d7e9f021ab` migration must be reviewed and separately authorized
|
||||
Risk grades are zero (no explicit risk found) through five stars. Pending, failed and insufficient information are distinct states. Article evidence, model identity and timestamps remain available in event history. The rolling dashboard windows use publication/progress timestamps; retrospective analysis is not a historical forecast. Model/market outages retain the prior outlook with an outdated marker. No event classification changes positions or order execution.
|
||||
|
||||
Candidate retrieval retains the article's previous event and ranks other recent events by headline relevance and severity. Each dashboard window selects up to 100 events independently. Context packing includes source text and the tool schema; oversized articles fail individually while other articles stay queued. News details refresh pending analysis every 15 seconds while visible and stop after completion or leaving the page. Deleting an enabled news provider returns 409; pausing analysis allows deletion and clears the saved provider reference.
|
||||
|
||||
## Global economic calendar
|
||||
|
||||
The independent `jin10-calendar` service runs Chromium and Jin10's official browser SDK. It collects the macroeconomic calendar only: economic data, important events and exchange holidays. The backend runtime image installs the matching Playwright headless Chromium and OS libraries; no browser is started in the API, official calendar, news, model or trading workers.
|
||||
|
||||
After the separately authorized migrations through `a8b1cd465ef3` and deployment, an administrator connects Jin10 in Settings using the Jin10 App QR flow. The account token is encrypted with the existing server encryption key and never returned to the browser. Disconnect retains history and invalidates in-flight writes; reconnect starts a new connection generation. Browser or authentication failures stay visible instead of being recorded as empty days.
|
||||
|
||||
The collector prioritizes today, checks yesterday and the next seven days, and fills missing days from 2025-01-01 Asia/Shanghai at a limited pace. A day receives a persistent coverage checkpoint only after all three category responses pass date/structure checks. Historical dates with no checkpoint are coverage gaps, not evidence that no events occurred. A restart resumes the first gap. Failures retain raw responses without advancing coverage. No historical completeness or realtime latency is guaranteed before actual collection finishes.
|
||||
|
||||
Official and Jin10 observations retain separate identities and revisions. The read API merges only verified indicator IDs, definitions, units, reference periods, release stages and exact publication times. Official nonmissing fields win independently; Jin10 fills missing fields and market forecasts with explicit provenance. Unverified definitions remain distinct records. Original and revised previous values remain separate. Forecast observations captured after publication are displayed with that limitation and excluded from historical surprise judgments. Jin10's gold/USD direction flags are not BTC/ETH signals. Tentative times and all-day holidays never display an invented exact midnight time.
|
||||
|
||||
CI acceptance runs `scripts/smoke_calendar.py` against the isolated database using public fixtures and synthetic account material. It never starts a browser collector or connects a real Jin10 account. Local unit tests likewise isolate all external I/O. The live database migration, credential import/reconnection, history collection and dev deployment are separate operator actions; ordinary local validation does not authorize them.
|
||||
@@ -44,6 +44,11 @@ services:
|
||||
container_name: AlphaPulse-dev-calendar
|
||||
command: [python, -m, alphapulse.calendar.worker]
|
||||
|
||||
jin10-calendar:
|
||||
<<: *backend
|
||||
container_name: AlphaPulse-dev-jin10-calendar
|
||||
command: [python, -m, alphapulse.calendar.jin10_worker]
|
||||
|
||||
web:
|
||||
image: ${ALPHAPULSE_WEB_IMAGE:?Set a verified web digest}
|
||||
container_name: AlphaPulse-dev
|
||||
|
||||
Reference in new issue
Block a user