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
//! Library support for the `devscout` code-indexing CLI.
//!
//! The parsing and extraction modules turn source files into fragments, the
//! graph and resolution modules connect those fragments, and the query and
//! rendering modules produce command results. The remaining modules locate
//! repositories, persist artifacts, and implement CLI commands and hooks.
//! `ARCHITECTURE.md` at the repository root maps every module to its
//! responsibility and invariants and says where a change goes.
/// `devscout audit --semantic`: scores `uses-member` graph edges against a
/// Roslyn-derived oracle.
/// Command-line argument parsing and dispatch.
/// C# and TypeScript declaration and reference extraction.
/// Persisted graph and fragment data structures.
/// Agent-hook input processing.
/// Repository initialization commands.
/// Manifest persistence, search, and index-freshness checks.
/// Repository mapping and incremental fragment-cache updates.
/// XAML and XML markup declaration and reference extraction.
/// Tree-sitter parsing and source-span collection.
/// C# conditional-compilation pre-pass: blanks the inactive arms of
/// `#if`/`#elif`/`#else`/`#endif` groups before the source is parsed.
/// Hand-scanned csproj/Directory.Build.props project model: discovery,
/// project units, and reference closure.
/// Graph queries and their result models.
/// Text rendering for query results.
/// Repository discovery and registry access.
/// Resolution of extracted C# fragments into a graph.
/// SQLite-backed hook freshness and content stores.
/// Symbol-name suggestions for unsuccessful queries.
/// Query-verb telemetry: one JSON line per invocation under `SCOUT_TELEMETRY=1`.
/// Resolution of extracted TypeScript fragments into a graph.
/// Source-tree walking and default file-purpose generation.
// Off every code path today: the crate feeds the grammar a UTF-16 view of
// source, so tree-sitter node offsets already arrive as UTF-16 and
// `parse::utf16_index` halves them instead of translating. Kept as a
// unit-tested helper for a future caller that has to cross a UTF-8 buffer back
// into that offset convention.
/// UTF-8 to UTF-16 source-offset conversion.