Skip to main content

magellan/
lib.rs

1//! Magellan: A dumb, deterministic codebase mapping tool
2//!
3//! Magellan observes files, extracts symbols and references, and persists facts to sqlitegraph.
4//!
5//! # Position Conventions
6//!
7//! Magellan uses tree-sitter position conventions for all symbol and reference data:
8//! - **Line positions**: 1-indexed (line 1 is the first line)
9//! - **Column positions**: 0-indexed (column 0 is the first character)
10//! - **Byte offsets**: 0-indexed from file start
11//!
12//! See [MANUAL.md](../MANUAL.md#3-position-conventions) for detailed documentation.
13
14pub mod common;
15pub mod diagnostics;
16pub mod error_codes;
17pub mod generation;
18pub mod graph;
19pub mod indexer;
20pub mod ingest;
21pub mod migrate_cmd;
22pub mod output;
23pub mod references;
24pub mod validation;
25pub mod verify;
26pub mod watcher;
27
28pub use common::{
29    detect_language_from_path, extract_context_safe, extract_symbol_content_safe, format_symbol_kind,
30    parse_symbol_kind, resolve_path,
31};
32pub use diagnostics::{DiagnosticStage, SkipReason, WatchDiagnostic};
33pub use generation::{ChunkStore, CodeChunk};
34pub use graph::filter::FileFilter;
35pub use graph::query::SymbolQueryResult;
36pub use graph::scan::ScanResult;
37pub use graph::test_helpers::{delete_file_facts_with_injection, FailPoint};
38pub use graph::{
39    CodeGraph, CondensationGraph, CondensationResult, Cycle, CycleKind, CycleReport,
40    DeadSymbol, DeleteResult, ExecutionPath, ExportConfig, ExportFormat, PathEnumerationResult,
41    PathStatistics, ProgramSlice, ReconcileOutcome, ScanProgress, SliceDirection, SliceResult,
42    SliceStatistics, Supernode, SymbolInfo, MAGELLAN_SCHEMA_VERSION,
43};
44pub use indexer::{run_indexer, run_indexer_n, run_watch_pipeline, WatchPipelineConfig};
45pub use ingest::detect::{detect_language, Language};
46pub use ingest::{Parser, SymbolFact, SymbolKind};
47pub use output::command::{MigrateResponse, ReferenceMatch, Span, SymbolMatch};
48pub use output::{generate_execution_id, output_json, JsonResponse, OutputFormat};
49pub use references::{CallFact, ReferenceFact};
50pub use validation::{
51    canonicalize_path, normalize_path, validate_path_within_root, PathValidationError,
52};
53pub use verify::{verify_graph, VerifyReport};
54pub use watcher::{EventType, FileEvent, FileSystemWatcher, WatcherBatch, WatcherConfig};