@ossl-dev/differens-tiers
The parsing pipeline. A content router picks a tier by file extension and magic bytes. The tier adapter parses the file into aNode tree for @ossl-dev/differens-core. If a tier fails to parse, or its diff falls back, the pipeline drops to the next lower tier. Raw line diff is the floor.
Install:
Tiers
Exports
classifyFile
Tier.Raw, not prose. Lines are structure in docs.
diffWithTier
- Entirely new or removed files become a single
Insert/Deleteof akind: "file"node. That is one fact, not a tree diff. - Identical sources short-circuit with no changes.
- A tier result is kept only if it parses and produces a usable tree diff; the core’s
fallbackverdict propagates instead of being reported as “no changes”. - On any failure the pipeline falls back to raw lines, with
fallback: "lines".
LanguageExtractor
Each code language is aLanguageExtractor: a few dozen match arms that map tree-sitter CST node types to canonical concepts. It is not a parser.
getExtractors() reports them as ExtractorInfo { language, level: "L6" | "L5", extensions }, where L6 extractors have semantic mappings and L5 are generic.