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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Token cost summary and trajectory types.
//!
//! Why: operators need to monitor the cost of running longitudinal profiles
//! across many contributors; separating these telemetry/direction types keeps
//! each file focused and under the 500-line cap.
//! What: defines `TokenCostSummary` and `Trajectory`.
//! Test: `token_cost_summary_defaults_to_zero` and `trajectory_serde_roundtrip`
//! in the parent `tests` module.
use ;
// ─── TokenCostSummary ─────────────────────────────────────────────────────────
/// Aggregate LLM token usage and cost for a profile generation run.
///
/// Why: operators need to monitor the cost of running longitudinal profiles
/// across many contributors, especially as the number of periods grows.
/// What: accumulates `input_tokens`, `output_tokens`, estimated `cost_usd`,
/// and wall-clock `latency_ms` across all LLM calls in a single profile run.
/// Test: see `token_cost_summary_defaults_to_zero`.
// ─── Trajectory ──────────────────────────────────────────────────────────────
/// Overall quality trajectory direction for a contributor over the profile
/// window.
///
/// Why: the profile narrative needs a single high-level signal that the LLM
/// and callers can use to route action (e.g. flag declining contributors for
/// coaching vs. commend improving ones).
/// What: three-variant enum serialised as `snake_case`.
/// Test: see `trajectory_serde_roundtrip`.