panproto-project
Multi-file project assembly via schema coproduct for panproto.
Overview
Orchestrates parsing all files in a project directory into a unified project-level schema. The project schema is the coproduct (disjoint union) of per-file schemas, with cross-file edges for imports and type references.
Two-pass approach
- Parse pass: For each file, detect language, parse via
ParserRegistry, prefix vertex IDs with the file path. - Resolve pass: Walk
importvertices, match against exports in other file schemas, emitimportsedges connecting them.
Coproduct construction
The schema-level coproduct prefixes each file's vertex names with the file path. Edges within a file retain their local structure. The result is a single Schema spanning the entire project.
The coproduct is universal: any morphism out of the project schema restricts to per-file morphisms. This means per-file diffs compose into project-level diffs automatically.
Usage
use ProjectBuilder;
let mut builder = new;
builder.add_directory?;
let project = builder.build?;
println!;
Language detection
File extensions are mapped to protocols: .ts to TypeScript, .py to Python, .rs to Rust, etc. Unrecognized files fall back to the raw_file protocol (text as ordered line vertices, binary as chunk vertices).
License
MIT