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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// The data model every other `audit` submodule shares: the reduced
// `graph.json`/oracle-record row shapes scoring reads, and the filesystem
// inputs `load` gathers and `score` consumes. No I/O and no scoring logic
// live here -- see `load.rs` and `score.rs`.
use ;
use ;
use AuditLane;
/// A `uses-member` edge's resolver tier. `Heuristic` is the legacy shape: a
/// `heuristic: true` edge with no `tier` string at all, which is how every
/// non-precise edge was written before the `tier` key and the `Ext`/`Guess`
/// split it carries existed. Both shapes must keep scoring, so this enum
/// spans them and `tier_of` (in `load.rs`) is the one place that maps either
/// onto it.
///
/// `Semantic` and `SemanticDiscovered` are the enriched lane's own two tiers,
/// appended last so no existing row or JSON key moves position. They are two
/// tiers, not one, so a per-reference override of an already-emitted
/// reference (`Semantic`) and a compiler-discovered site the extractor never
/// emitted a reference for at all (`SemanticDiscovered`) structurally cannot
/// share one `TierStats` row -- the two populations must never be pooled,
/// and keeping them in separate enum variants makes that true by
/// construction rather than by convention.
/// One `uses-member` edge out of graph.json, reduced to the fields scoring
/// needs. `to_file`/`to` are the graph's own def id and its declaring file --
/// `graph.rs`'s `Def.file` is the def's first-insertion file for a partial
/// class, so a member declared in a second `also_in` file is joined on that
/// first file here too -- the join is on def id alone, never on the declaring
/// file, precisely so a partial class does not split into two answers.
/// `member` is schema 2's own member-name key (`graph.rs`'s
/// `Edge::UsesMember.member`) -- `None` for a schema-1 edge (no `member` key
/// on disk at all) or the rare reference the extractor recorded no member
/// name for; either way `None` makes this edge's second half of the match
/// rule (`member_matches`, in `scoring.rs`) unconstrained, which is what
/// keeps a schema-1 graph's scoring byte-identical to before this field
/// existed.
/// A graph.json def, reduced to what scoring needs -- and, doubling as the
/// shape `--defs <defs.jsonl>` deserializes into directly (that oracle
/// record has the same four field names; see `load.rs`). `test` is "does
/// this def carry at least one method with a devscout-recognized test
/// attribute" (graph.json's `testMethods` array, non-empty) for a
/// graph-sourced row, or the oracle's own equivalent Roslyn-derived flag for
/// an oracle-sourced one.
/// One line of `refs.jsonl`, the oracle's ground-truth member-reference
/// records -- reduced (see the module header) to what scoring reads.
/// `target`/`targetKind`/`targetFile` are `Option` because the oracle writes
/// `null` for an unknown value; `member` is not --
/// `tools/scout-semantic`'s `Records.cs` declares it a non-nullable `string`,
/// and every syntax shape the oracle walks (`a.M`, `?.M`, a bare `M(...)`)
/// names a member by construction -- and every other field here is always
/// present on a real oracle record too.
/// One line of `units.jsonl` -- a compiled project, reduced to what the
/// structural check needs: `status` (ok/failed unit counts, and whether a
/// file belongs to a failed unit at all -- excluded from the audit
/// universe), `refs` (other unit names this unit's `ProjectReferences` name,
/// the raw material for the reachability closure `reach` builds), and
/// `files` (the file->unit membership map `file_to_unit` builds), and `name`
/// (the key `refs`/`file_to_unit` join on). `test`/`tfm`/`diagnostics` from
/// the oracle's own schema are not carried: nothing here reads a unit's own
/// `test` flag (only a *def's* `test` flag, via `DefRow`, matters to the
/// fallback structural check).
/// Filesystem inputs to one audit run -- everything `load` gathers and
/// `score` consumes. Held together so `score` stays a single-argument pure
/// function: no field here is touched by any I/O once this value exists.
/// `load`'s filesystem arguments -- the resolved, already-`-C`-aware paths
/// for the three input files `cmd_audit` accepts.