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
74
75
76
77
78
79
80
81
82
83
84
85
//! Period batch and sampled-diff types for the profile pipeline.
//!
//! Why: the LLM profile pass consumes one `PeriodBatch` per period, which
//! combines statistical summaries with concrete diff examples; separating these
//! types from the top-level `ContributorProfile` keeps each file focused.
//! What: defines `PeriodBatch` and `SampledDiff`.
//! Test: `sampled_diff_serde_roundtrip` and `period_batch_serde_roundtrip` in the
//! parent `tests` module.
use ;
// Re-export the tga type so callers within this module can use the short form.
pub use AuthorPeriodSummary;
// ─── SampledDiff ──────────────────────────────────────────────────────────────
/// A representative commit diff sampled from a contributor's history.
///
/// Why: the LLM-based profile pass needs concrete diff text to reason about
/// code quality trends; raw `AuthorPeriodSummary` statistics alone are
/// insufficient for nuanced commentary.
/// What: pairs a commit's metadata (sha, repo, message, category, effort) with
/// the truncated unified diff text produced by `diff_for_commit`.
/// Test: see `sampled_diff_serde_roundtrip` and the diff-sampler unit tests.
// ─── PeriodBatch ─────────────────────────────────────────────────────────────
/// Combined statistics and sampled diffs for a single N-week period.
///
/// Why: the LLM profile pass consumes one `PeriodBatch` per period, which
/// combines the statistical summary with concrete diff examples so the model
/// can correlate quantitative trends with qualitative observations.
/// What: embeds a tga [`AuthorPeriodSummary`] (reused directly — no
/// redefinition) and appends the `sampled_diffs` produced by the diff
/// sampler. `sampled_diffs` is empty until the diff-sampler stage fills it.
/// Test: see `period_batch_serde_roundtrip`.