Skip to content

T-ZAZO-intersect-fs-layer

Status: closed/done · Impact: medium · Complexity: medium

Implement intersect/fsfilesInScope and resolveIntersection — wrapping a filesystem globber and filtering with the pure path API, as a subpath entry so the core stays dependency-free.

The fs surface and its fixtures exist as stubs from T-FGMJ; the path API used to filter enumerated files is implemented by T-IRYT.

LocationRole today
plugin/lib/intersect/fs.tsfs surface — throwing stubs.
plugin/lib/intersect/index.tsThe path API used to filter enumerated files.
plugin/lib/intersect/fixtures/fs.cases.jsonfs spec, all pending.
package.jsonRoot manifest; new runtime deps for the workspace land here.

intersect/fs is implemented over a chosen globber; filesInScope(patterns, {cwd,…}) enumerates on-disk files matching the scope, resolveIntersection(a, b, …) returns the files matching both; the core entries (intersect, intersect/segments) still pull zero runtime deps. fs fixtures run as integration tests over a temp tree.

  1. Choose the globber (fast-glob or tinyglobby) and add it as a dependency used only by fs.ts.
  2. filesInScope(patterns, opts): glob the tree under cwd honoring ignore/onlyFiles/absolute; post-filter the results through the path API’s matches so fs semantics are identical to the pure layer.
  3. resolveIntersection(a, b, opts): filesInScope(a, opts) then keep those that also matches(_, b).
  4. Convert the fs fixtures to an integration harness: each case declares a file list to materialize under a temp dir, the op + args, and the expected relative paths; the harness builds the tree, runs the op, asserts, and cleans up.
  5. Assert the core entries do not transitively load the globber.
LocationKindChange
plugin/lib/intersect/fs.tsmodifyImplement filesInScope / resolveIntersection.
plugin/lib/intersect/tests/fs.test.tsnewTemp-tree integration harness for the fs cases.
plugin/lib/intersect/fixtures/fs.cases.jsonmodifyActivate as integration cases (temp-dir file lists).
package.jsonmodifyAdd the chosen globber to dependencies.
  • AC-1: The fs.cases.json integration cases pass against materialized temp trees.
  • AC-2: filesInScope(["a/**"], { cwd }) returns exactly the files under a/ in the fixture tree; resolveIntersection returns their intersection with the second scope.
  • AC-3: A test asserts that importing intersect or intersect/segments does not load the globber (dependency-isolation check).
  • AC-4: bunx tsc --noEmit passes.
  • Package exports finalization and extraction — T-9XXD.
  • Watch mode / streaming enumeration.
  • Requires the implemented path API from T-IRYT.
  • The L2 section of D-4FRD-intersect-api layered-api.md; serves DR-0011 (context assembly).

T-IRYT


← Back to Tasks