File size: 1,151 Bytes
557ee65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
41
42
43
44
45
46
47
from dataclasses import dataclass
from datetime import date
from typing import Optional


@dataclass
class RunnerIntelligenceSnapshot:
    """
    Central intelligence artifact representing the current state of a runner.
    
    This object serves as the canonical interface between the pipeline and:
    - UI (Gradio)
    - Integrations (Strava / WhatsApp)
    - Observability analytics
    
    It aggregates derived signals without altering pipeline logic.
    Fields are raw values rather than translated text, allowing i18n
    at the edge (e.g. UI).
    """

    week_start: Optional[date]

    # Training state and health
    training_state: Optional[str]
    health_signal: Optional[str]

    # Positioning
    positioning_status: Optional[str]
    positioning_change: Optional[str]

    # Goals
    goal_trajectory: Optional[str]
    goal_progress_pct: Optional[float]

    # Advice / Future
    next_run: Optional[str]
    training_focus: Optional[str]

    # Insights
    key_insight: Optional[str]
    forward_focus: Optional[str]   

    # Quantitative Metrics
    weekly_distance_km: float
    run_count: int
    consistency_score: int