fix(detect): forward follow_symlinks from detect_incremental to detect#736
Merged
safishamsi merged 1 commit intoMay 6, 2026
Merged
Conversation
`detect_incremental(root)` always called `detect(root)` without forwarding the `follow_symlinks` kwarg. As a result, corpora that include symlinked sub-trees pointing to directories outside the scan root (e.g. a `state_of_truth/` symlink pointing at `~/.hermes/state_of_truth/`) were visible to a full `detect()` run with `follow_symlinks=True` but invisible to any subsequent `--update` run. The incremental scan would then either report no changes (silently dropping legitimate new files) or repeatedly re-extract a phantom subset, depending on what was reachable without crossing symlinks. Add a keyword-only `follow_symlinks` parameter to `detect_incremental()` and forward it. Default stays `False` for backwards compatibility — only callers that already opt in to symlink following on `detect()` pick up the new behaviour for incremental runs too. Test: a corpus with a symlinked directory is invisible with `follow_symlinks=False`, fully indexed with `follow_symlinks=True`, and correctly reports zero new files on a second incremental scan after the manifest is saved.
hypnwtykvmpr
pushed a commit
to hypnwtykvmpr/vampyre
that referenced
this pull request
May 7, 2026
… detect_incremental to detect
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.
Problem
detect_incremental(root)always calleddetect(root)without forwarding thefollow_symlinkskwarg added in #33. As a result, corpora that include symlinked sub-trees pointing to directories outside the scan root were visible to a fulldetect()run withfollow_symlinks=Truebut invisible to any subsequent--updaterun.Concrete failure case
A user has a knowledge corpus laid out like:
```
~/.hermes/graphify-jarvis/
├── state_of_truth -> ~/.hermes/state_of_truth (symlink)
├── memories -> ~/.claude/.../memory (symlink)
└── graphify-out/
```
Initial
/graphify <path>build (with the appropriatefollow_symlinks=Trueplumbed in) correctly indexed ~95 files via the symlinks. Subsequent/graphify <path> --updateruns only saw 3 files (the contents ofgraphify-out/itself) becausedetect_incrementalre-calleddetect(root)without the flag, silently dropping the symlinked sub-trees. New SoT reports and memories were never picked up by incremental scans.Fix
Add a keyword-only
follow_symlinksparameter todetect_incremental()and forward it todetect(). Default staysFalsefor backwards compatibility — only callers that already opt in to symlink following ondetect()pick up the new behaviour for incremental runs too.Test
Added
test_detect_incremental_propagates_follow_symlinkscovering the regression: a corpus with a symlinked directory is invisible withfollow_symlinks=False, fully indexed withfollow_symlinks=True, and correctly reports zero new files on a second incremental scan after the manifest is saved.```
$ pytest tests/test_detect.py -v
============================== 30 passed in 0.07s ==============================
```
Caller note
The CLI / skill currently doesn't expose
--follow-symlinksas a flag, butwatch.pyalready plumbs it through to the full-detect()rebuild path. This PR keeps the same opt-in shape: callers that already passfollow_symlinks=Truetodetect()will now see consistent behaviour on--update. Wiring a--follow-symlinksCLI flag through to bothdetect_incrementaland the existingdetect()callsites would be a small follow-up if you want.