Skip to content

fix(recall): scope filter requires directory boundary match - #38

Open
Apageoflove wants to merge 1 commit into
tigerless-labs:mainfrom
Apageoflove:fix/scope-filter-directory-boundary
Open

Apageoflove wants to merge 1 commit into
tigerless-labs:mainfrom
Apageoflove:fix/scope-filter-directory-boundary

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Sep 16, 2026

Copy link
Copy Markdown

scope=user was matching username/settings.md and user-notes/xxx.md because _in_scope does a raw startswith without checking for a directory boundary. So scope=user leaks results from every domain whose name starts with "user".

Fixed by stripping the trailing slash and requiring either an exact match or a slash after the prefix. Added a regression test covering the collision cases (username, user-notes, user2, users).

_in_scope used raw startswith(scope), so scope=user also matched
username/, user-notes/, user2/, and any domain whose name begins
with user. Fix: strip trailing slash, then require exact match or
a directory separator after the prefix.
@Apageoflove

Copy link
Copy Markdown
Author

Just noticed PR #33 covers the same issue with the same directory-boundary approach — it was filed six days before mine and I somehow missed it while working from #17. The only thing mine adds is a regression test for the similar-prefix case. I haven't read #33's branch closely, so not sure yet whether its tests already cover that case too. Happy to close this one or rebase the test onto #33, whatever is less work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant