Skip to main content

relay_knowledge/code/
mod.rs

1//! Code repository indexing, parsing, identity, and source discovery boundaries.
2
3mod business_glossary;
4mod config_files;
5mod content_identity;
6mod error;
7pub(crate) mod feature_flags;
8mod generated_detection;
9mod identity;
10mod index;
11mod language_metadata;
12mod parser;
13mod registration;
14mod search;
15mod source;
16
17#[cfg(test)]
18#[path = "tests/source/declarations.rs"]
19mod source_declaration_tests;
20#[cfg(test)]
21#[path = "tests/source/filesystem.rs"]
22mod source_filesystem_tests;
23#[cfg(test)]
24#[path = "tests/source/layout.rs"]
25mod source_layout_tests;
26#[cfg(test)]
27#[path = "tests/source/submodule_followup.rs"]
28mod source_submodule_followup_tests;
29#[cfg(test)]
30#[path = "tests/source/submodule_regression.rs"]
31mod source_submodule_regression_tests;
32#[cfg(test)]
33#[path = "tests/source/submodule_review.rs"]
34mod source_submodule_review_tests;
35#[cfg(test)]
36#[path = "tests/source/submodule.rs"]
37mod source_submodule_tests;
38#[cfg(test)]
39#[path = "tests/fixtures.rs"]
40mod test_fixtures;
41#[cfg(test)]
42#[path = "mod_tests.rs"]
43mod tests;
44#[cfg(test)]
45#[path = "tests/source/worktree_overlay_review.rs"]
46mod worktree_overlay_review_tests;
47#[cfg(test)]
48#[path = "tests/source/worktree_overlay.rs"]
49mod worktree_overlay_tests;
50
51pub(crate) use business_glossary::load_business_knowledge_projection;
52pub use error::CodeIndexError;
53pub(crate) use index::CodeIndexPlanRecovery;
54pub use index::{
55    CodeIndexPlan, prepare_full_index_plan, prepare_full_index_plan_with_workspace_detection,
56};
57pub use index::{
58    build_index_snapshot, changed_paths_for_diff, changed_paths_for_diff_with_filters,
59    changed_paths_for_diff_with_path_filters, deleted_symbol_names_for_diff,
60};
61pub use registration::register_repository;
62pub use scope::{partition_changed_paths_for_selector, preview_repository_scope};
63pub(crate) use source::git::{
64    first_parent_ancestors_bounded, repository_worktree_observation_bounded,
65    resolve_git_ref_bounded, resolve_git_tree_bounded,
66};
67pub use source::resolution::{
68    resolve_repository_ref, resolve_repository_ref_with_filters,
69    resolve_repository_ref_with_path_filters, resolve_repository_snapshot,
70    resolve_repository_snapshot_with_filters, resolve_repository_snapshot_with_path_filters,
71};
72
73#[cfg(test)]
74pub(crate) use changes::{
75    reset_tracked_entries_call_count_for_root, tracked_entries_call_count_for_root,
76};
77#[cfg(test)]
78pub(crate) use git::{
79    git_ls_tree_full_scan_call_count_for_root, git_show_call_count_for_root,
80    reset_git_ls_tree_full_scan_call_count_for_root, reset_git_show_call_count_for_root,
81};
82#[cfg(test)]
83pub(crate) use index::build_index_snapshot_with_base_commit;
84pub(crate) use index::changed_paths_for_filesystem_diff;
85pub(crate) use index::clean_worktree_overlay_hash;
86pub(crate) use index::compute_worktree_overlay_identity;
87#[cfg(test)]
88use index::impact_paths_from_changes;
89#[cfg(test)]
90pub(crate) use index::mutate_next_filesystem_full_snapshot_read;
91pub(crate) use index::{
92    build_index_snapshot_with_workspace_detection, historical_reuse_diff_fits_budget,
93    repository_uses_filesystem_source,
94};
95pub(crate) use registration::REGISTRATION_LANGUAGE_FILTER_ERROR;
96pub(crate) use search::{
97    SOURCE_GREP_CANDIDATE_FILE_LIMIT, SourceGrepKind, SourceGrepMatch, SourceGrepOutcome,
98    SourceGrepRequest, bounded_source_grep_candidate_match_limit,
99    source_fallback_reference_language_is_code, source_grep_matches,
100    source_grep_matches_from_worktree_overlay,
101};
102#[cfg(test)]
103use source::gitlink as source_gitlink;
104pub(crate) use source::roots as source_roots;
105use source::{changes, declarations as source_declarations, git, layout as scope};
106pub(crate) use source_declarations::{
107    SourceDeclarationMatch, safe_git_blob_path, simple_source_identifier,
108    source_declarations_for_identity, source_declarations_for_identity_from_worktree_overlay,
109    source_line_defines_identity,
110};
111
112use content_identity as ids;
113use ids::{stable_content_hash, stable_id};
114use index::snapshot;
115use index::snapshot::SnapshotBuild;
116use language_metadata as languages;
117#[cfg(test)]
118use parser::parse_indexed_file;
119
120#[cfg(test)]
121use {
122    crate::domain::{
123        CodeFileFingerprint, CodeIndexMode, CodeRepositoryRegistration, CodeRepositorySelector,
124    },
125    changes::{tracked_entries, worktree_changed_paths},
126    identity::resolve_reference_targets,
127    languages::language_id,
128    scope::{path_is_selected, path_scope_allows, path_scope_overlaps},
129    source::{RepositorySourceKind, source_snapshot_batch_bytes},
130};