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/// Resolve-time consumption of admitted compiler facts: same-context
48/// precedence, compiler-discovered-site projection, freshness, and
49/// uncertainty mapping.
50pub mod semantic;
51/// SQLite-backed hook freshness and content stores.
52pub mod store;
53/// Symbol-name suggestions for unsuccessful queries.
54pub mod suggest;
55/// Query-verb telemetry: one JSON line per invocation under `SCOUT_TELEMETRY=1`.
56pub mod telemetry;
57/// The independent semantic-truth, profile, and falsification harness.
58pub mod truth;
59/// Resolution of extracted TypeScript fragments into a graph.
60pub mod tsgraph;
61/// Source-tree walking and default file-purpose generation.
62pub mod walk;
63
64// Off every code path today: the crate feeds the grammar a UTF-16 view of
65// source, so tree-sitter node offsets already arrive as UTF-16 and
66// `parse::utf16_index` halves them instead of translating. Kept as a
67// unit-tested helper for a future caller that has to cross a UTF-8 buffer back
68// into that offset convention.
69/// UTF-8 to UTF-16 source-offset conversion.
70pub mod offsets;