Skip to main content

seshat_scanner/
lib.rs

1//! # Seshat Scanner
2//!
3//! Parses source code files into intermediate representation (IR) using
4//! Tree-sitter grammars. Produces [`seshat_core::ProjectFile`] structs
5//! consumed by convention detectors.
6//!
7//! Responsibilities:
8//! - File discovery with `.gitignore` respect (via `ignore` crate)
9//! - Tree-sitter AST parsing for Rust, TypeScript, JavaScript, Python
10//! - Dependency manifest analysis (`Cargo.toml`, `package.json`, `pyproject.toml`)
11//! - Documentation ingestion (Markdown, JSON schema, OpenAPI)
12//! - Content hashing (SHA256) for incremental change detection
13
14pub mod discovery;
15pub mod documentation;
16pub mod error;
17pub mod git_dates;
18pub mod git_utils;
19pub mod manifest;
20pub mod module_structure;
21pub mod orchestrator;
22pub mod parser;
23pub mod registry;
24
25pub use discovery::{DiscoveredFile, DiscoveryResult, detect_submodule_paths, discover_files};
26pub use documentation::{DocType, DocumentationResult, parse_documentation};
27pub use error::ScanError;
28pub use git_dates::collect_git_file_dates;
29pub use git_utils::{
30    FreshnessCheck, check_branch_freshness, get_head_commit, record_branch_scan_complete,
31};
32pub use manifest::{
33    DeclaredDependency, ManifestAnalysis, ManifestType, analyze_manifests, categorize_dependency,
34    parse_manifest,
35};
36pub use module_structure::{ModuleGraph, ModuleInfo, build_module_graph};
37pub use orchestrator::{
38    IncrementalStats, ScanProgress, ScanResult, scan_project, scan_project_with_progress,
39};
40pub use parser::{Parser, content_hash, parse_file, read_and_parse_file};
41pub use registry::{
42    CACHE_TTL_SECS, PackageMetadata, PackageRegistryClient, Registry, RegistryError,
43    crates_io::CratesIoClient,
44    npm::NpmClient,
45    pypi::PyPIClient,
46    registry_mapping::{
47        ClassificationConfidence, ClassificationResult, classify_with_registry,
48        infer_domain_from_metadata, map_crates_io_category, map_keyword, map_pypi_classifier,
49    },
50};