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
//! The plugin↔orchestrator **metric contract**: the raw tier-1 counts a language
//! plugin measures for one unit ([`MetricInputs`]) and a sub-file unit carrying
//! them ([`FunctionUnit`]).
//!
//! These are pure data. A plugin's metric engine *produces* them; the
//! orchestrator (`code-ranker-graph`) *consumes* them — running the tier-2 CEL
//! registry from `metrics/builtin.toml` and writing every metric onto the node.
//! They live here in the foundation crate so a plugin depends only on this API,
//! never on the heavier graph/enrichment crate, to hand back its measurements.
/// Raw tier-1 counts a per-language engine measures for one unit (a file or, for
/// the `functions` level, a function). Every tier-2 metric is a pure function of
/// these, evaluated by the orchestrator's built-in registry — see
/// `code-ranker-graph`'s `metrics/builtin.toml`.
/// One sub-file unit (a function / method / closure) with its tier-1 counts.
/// Produced by a language engine's `compute_functions` for the optional
/// `functions` level. `kind` is a free-form, per-language string
/// (`fn` / `method` / `closure` / `lambda` / …).