Path-pattern overlap engine
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”- Decides whether two path patterns (globs) or a path and a pattern share a common matching path, as pure pattern algebra with no filesystem access.
- Layered as a zero-dependency segment core and path-string API, with an opt-in
fslayer for resolving against a real tree.
Statement
Section titled “Statement”Intersect answers one question — do two path patterns overlap? — by compiling each glob into an
automaton and testing product-automaton reachability, never touching disk except through its
separate fs entry point. It exposes pairwise primitives (intersects, matches, whichMatch,
overlapping, witness) and a compiled Matcher for repeated queries against a fixed pattern
set, plus a registry (index) for resolving which labeled pattern-sets (guidelines, standards)
apply to a scope.
What it provides
Section titled “What it provides”intersects/matches/overlapping/witnesspairwise overlap primitives over glob stringscompilefor an amortizedMatcherbound to a fixed pattern setindex/registryfor scope-to-labeled-pattern-set resolution@sksizer/intersect/fsfor resolving patterns against real files (pullstinyglobby)
Underlying implementation
Section titled “Underlying implementation”- packages/ts/intersect/index.ts (L1 path API)
- packages/ts/intersect/segments/ (L0 core engine)
- packages/ts/intersect/fs.ts (L2 filesystem layer)
Locations
Section titled “Locations”packages/ts/intersect/packages/ts/intersect/index.tspackages/ts/intersect/segments/index.tspackages/ts/intersect/fs.tspackages/rust/intersect/packages/rust/intersect/src/path.rs#intersectspackages/rust/intersect/src/segments/packages/rust/intersect/src/fs.rs#resolve_intersection