-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate.py
More file actions
39 lines (32 loc) · 1.88 KB
/
Copy pathstate.py
File metadata and controls
39 lines (32 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from __future__ import annotations
from typing import TypedDict
class PipelineState(TypedDict, total=False):
# ── Filters (populated from CONFIG by run.py) ──────────────────────────
run_mode: str # "live" | "backtest"
exchanges: list[str]
languages: list[str]
date_range: tuple[str, str] # effective range, resolved from run_mode
subjects: list[str]
industries: list[str] | None
tags: list[str] | None
continents: list[str] | None
countries: list[str] | None
states: list[str] | None
page_size: int
# ── Computed during run ────────────────────────────────────────────────
base_url: str
article_stubs: list[dict] # {title, published_date, source, link}
articles: list[dict] # {title, published_date, source, link, body}
export_path: str
# ── Signal results (link → record) ────────────────────────────────────
signal_records: dict # link → {extracted, enriched, signal, evaluation}
# ── Final output ───────────────────────────────────────────────────────
merged_articles: list[dict]
run_summary: dict
class ArticleSignalState(TypedDict, total=False):
article: dict # full article dict with body
extracted: dict | None
enriched: dict | None
signal_record: dict | None # {link, extracted, enriched, signal, evaluation}
skipped: bool
skip_reason: str | None # "no_ticker" | "error:<msg>"