pub enum CorpusScope {
Production,
Test,
Fixture,
Example,
Generated,
Vendor,
Docs,
}Expand description
Repository role of a source file and every graph node declared in it.
Scope is persisted per file by the store rather than repeated in every node blob. The path classifier is deliberately conservative: repositories can override an exceptional path, while an uncertain path remains production instead of disappearing from the default agent corpus.
Variants§
Implementations§
Source§impl CorpusScope
impl CorpusScope
pub const ALL: [Self; 7]
pub fn as_str(self) -> &'static str
pub fn from_str_opt(value: &str) -> Option<Self>
Sourcepub fn classify_path(file: &str) -> Self
pub fn classify_path(file: &str) -> Self
Conservative path-only classification used when a repository has no
explicit override. Rules operate on complete path components and
well-known generated suffixes to avoid hiding ordinary source whose
name merely contains words such as test or example.
Test-infrastructure directories (harness, bench, benches,
benchmark, benchmarks, eval, evals, e2e) count only as the
top-level component: a crate or module literally named eval under
crates/ or src/ stays production. Nested fixtures, golden,
testdata, examples, and tests components still match anywhere.
Rust convention: tests.rs, *_tests.rs, and test_*.rs basenames
are test files wherever they sit under src/.
Trait Implementations§
Source§impl Clone for CorpusScope
impl Clone for CorpusScope
Source§fn clone(&self) -> CorpusScope
fn clone(&self) -> CorpusScope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more