refactor(core): overhaul file filtering, fix set -e traps, and add extraction summaries#1
Merged
JacksonFergusonDev merged 1 commit intomainfrom Apr 16, 2026
Conversation
…traction summaries - Centralized noise/asset filtering in core.sh to explicitly exclude media and data binaries, hiding them from the fzf menu. - Added a file size intercept to prevent empty files (__init__.py) from being incorrectly flagged and skipped as binary. - Implemented a 1500-line global failsafe for text files to protect LLM context windows from monolithic files. - Fixed a `set -euo pipefail` bug in libexec/files caused by post-incrementing `((var++))` from zero. - Added a terminal summary report to `focal files` detailing exact counts of added, empty, truncated, and skipped files.
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.
Description
This PR addresses several edge cases in the context extraction pipeline related to file classification, terminal feedback, and Bash strict mode constraints.
Previously, the
file --mime-encodingcheck was too slow, misclassified empty files (like__init__.py) as binary, and allowed noisy text-based assets (like.svgor minified CSS) to leak into the LLM context. Furthermore, thefocal filescommand lacked visibility into skipped or truncated files and contained aset -etrap during file counting.Changes
FOCAL_NOISE_EXTSarray inlib/core.sh(mirroring the Python backend). These extensions are compiled into regex for the formatter and injected intofdflags to keep thefzfUI clean of noisy assets.[ ! -s "$file" ]intercept informat_file_for_llmto ensure empty structural files (e.g.,__init__.py) are captured rather than discarded as binaries.((var++))) inlibexec/fileswith safe arithmetic assignments (var=$((var + 1))) to prevent premature script termination when initialized at zero underset -e.focal filesnow tallies the status of all processed files and prints a clean, macroscopic summary to stdout upon completion.