Aling33 6b463d1f1a
fix(sandbox): search user data instead of hiding it as repository noise (#8366)
* fix(sandbox): search user data instead of hiding it as repository noise (#8364)

The ignore list was written to walk source checkouts, but glob, grep and ls ran
it over every root, so /mnt/user-data/uploads hid its own *.log files and a
grep over *.log answered 'No matches found'. grep also skipped any file above
1 MB during a directory walk without saying so, even when the model named the
file itself.

ignore_rules_for() now picks the filter per search root: user-data roots hide
only repository machinery, a glob the caller spelled out wins even inside a
checkout, and a file named as the search root is read at any size. The 1 MB
bound still protects directory walks, and the grep tool documents it.

* fix(sandbox): label user-data roots from the mount table

The public ls/glob/grep tools resolve /mnt/user-data/... to host paths
before they call the local provider, so checking the virtual prefix never
matched a real entry point: an uploaded app.log stayed hidden whenever the
host tree sat inside the checkout the Gateway runs from.

Ask the provider's mount table instead, and keep in-flight .upload-*.part
files hidden in user data as well as in a repository.

* fix(sandbox): keep the repository filter outside user data

Only a root the mount table labels as /mnt/user-data changes behaviour. A
skills mount or an ad-hoc host path keeps hiding *.log as before, so the
existing mounted-root tests stay valid instead of widening content
visibility to every root outside a checkout.

* fix(sandbox): keep an explicit grep budget on a named file

The traversal default stops a directory walk from reading megabytes it was
never asked about. A caller that names one file and passes its own budget
still gets that budget enforced, which the literal-grep suite pins.

---------

Co-authored-by: Aling33 <Aling33@users.noreply.github.com>
2026-11-19 07:55:35 +08:00
..