feat(source): replace source filters with filesets#244
Merged
Conversation
dpc
marked this pull request as ready for review
July 24, 2026 18:24
### Summary Replace Flakebox’s bespoke source filtering API with a thin `flakeboxLib.source` namespace built on nixpkgs filesets. The new API validates literal paths, exposes upstream set composition, retains an explicit directory-pruning predicate escape hatch, and offers glob traversal as an explicit alternative. Migrate Flakebox, its template, checks, and documentation to raw path roots and remove the legacy API without compatibility aliases. ### Details Add `filesetFromPaths`, `fromFileset`, `fromPaths`, and feature-detected `fromGlobs`, plus canonical `all`, `any`, `not`, and `excludeDirectoriesNamed` filters. Focused fixtures verify source identity under excluded and selected content changes, literal validation, out-of-root rejection, missing and optional paths, overlap/duplicate set semantics, composition, symlinks, nested pruning, basename boundaries, combinator short-circuiting, and glob behavior. The migration also removes stale nonexistent `.cargo` selections that fileset validation exposed in two check fixtures. ### Reviews An independent holistic review passed with no actionable correctness, completeness, Nix semantics, API, test, documentation, or migration findings. GitHub lint subsequently caught invalid placeholder TOML in the focused fixtures; replace it with valid empty workspace manifests so the repository-wide Cargo check can parse them. ### Validation `nix develop -c selfci check` passed all main, treefmt/lint, and flake-check jobs after the rebase and fixture correction. The repository pre-commit hook, focused source test build, and `nix flake check --no-build` also passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Posted by Tau
Summary
Replace Flakebox’s bespoke source filtering API with a thin
flakeboxLib.sourcenamespace built on nixpkgs filesets. The new API validates literal paths, exposes upstream set composition, retains an explicit directory-pruning predicate escape hatch, and offers glob traversal as an explicit alternative. Migrate Flakebox, its template, checks, and documentation to raw path roots and remove the legacy API without compatibility aliases.Details
Add
filesetFromPaths,fromFileset,fromPaths, and feature-detectedfromGlobs, plus canonicalall,any,not, andexcludeDirectoriesNamedfilters. Focused fixtures verify source identity under excluded and selected content changes, literal validation, out-of-root rejection, missing and optional paths, overlap/duplicate set semantics, composition, symlinks, nested pruning, basename boundaries, combinator short-circuiting, and glob behavior. The migration also removes stale nonexistent.cargoselections that fileset validation exposed in two check fixtures.Reviews
An independent holistic review passed with no actionable correctness, completeness, Nix semantics, API, test, documentation, or migration findings.
Validation
nix develop -c selfci checkpasses all main, treefmt/lint, and flake-check jobs. The focused source test build andnix flake check --no-buildalso pass.