Skip to main content

devscout_rs/
lib.rs

1//! Library support for the `devscout` code-indexing CLI.
2//!
3//! The parsing and extraction modules turn source files into fragments, the
4//! graph and resolution modules connect those fragments, and the query and
5//! rendering modules produce command results. The remaining modules locate
6//! repositories, persist artifacts, and implement CLI commands and hooks.
7//! `ARCHITECTURE.md` at the repository root maps every module to its
8//! responsibility and invariants and says where a change goes.
9
10/// `devscout audit --semantic`: scores `uses-member` graph edges against a
11/// Roslyn-derived oracle.
12pub mod audit;
13/// Command-line argument parsing and dispatch.
14pub mod cli;
15/// C# and TypeScript declaration and reference extraction.
16pub mod extract;
17/// Query-time index-freshness state for a programmatic (`--json`) consumer.
18pub mod freshness;
19/// Persisted graph and fragment data structures.
20pub mod graph;
21/// Agent-hook input processing.
22pub mod hookio;
23/// Repository initialization commands.
24pub mod initcmd;
25/// Manifest persistence, search, and index-freshness checks.
26pub mod manifest;
27/// Repository mapping and incremental fragment-cache updates.
28pub mod mapcmd;
29/// XAML and XML markup declaration and reference extraction.
30pub mod markup;
31/// Tree-sitter parsing and source-span collection.
32pub mod parse;
33/// C# conditional-compilation pre-pass: blanks the inactive arms of
34/// `#if`/`#elif`/`#else`/`#endif` groups before the source is parsed.
35pub mod preproc;
36/// Hand-scanned csproj/Directory.Build.props project model: discovery,
37/// project units, and reference closure.
38pub mod project;
39/// Graph queries and their result models.
40pub mod query;
41/// Text rendering for query results.
42pub mod render;
43/// Repository discovery and registry access.
44pub mod repo;
45/// Resolution of extracted C# fragments into a graph.
46pub mod resolve;
47/// SQLite-backed hook freshness and content stores.
48pub mod store;
49/// Symbol-name suggestions for unsuccessful queries.
50pub mod suggest;
51/// Query-verb telemetry: one JSON line per invocation under `SCOUT_TELEMETRY=1`.
52pub mod telemetry;
53/// The independent semantic-truth, profile, and falsification harness.
54pub mod truth;
55/// Resolution of extracted TypeScript fragments into a graph.
56pub mod tsgraph;
57/// Source-tree walking and default file-purpose generation.
58pub mod walk;
59
60// Off every code path today: the crate feeds the grammar a UTF-16 view of
61// source, so tree-sitter node offsets already arrive as UTF-16 and
62// `parse::utf16_index` halves them instead of translating. Kept as a
63// unit-tested helper for a future caller that has to cross a UTF-8 buffer back
64// into that offset convention.
65/// UTF-8 to UTF-16 source-offset conversion.
66pub mod offsets;