FileRepository.ListByPrefix (internal/database/files.go:231-241) selects with path LIKE ? || '%'. That is a plain string prefix, not a path prefix. It is case-insensitive for ASCII, and any _ or % in the argument acts as a wildcard. It has two callers:
Restore path arguments (internal/vaultik/restore.go:781-813). Measured on next at 0700901: asking for .../doc/ also restored doc2/b.txt, Doc3/c.txt and doc.txt.bak. Cleaning the filter removes the trailing slash, so the slash does not help. The help text says only matching files and directories are restored.
The scanner's known-file load for a backup path (internal/snapshot/scanner.go:425). Files from any other configured path that merely starts with this one are counted as deleted in the backup summary (the comparison is at scanner.go:1913-1927).
Acceptable: a path selects exactly that path and everything beneath it (p itself, or anything starting with p/), compared case-sensitively and with no wildcard characters.
Definition of done
ListByPrefix, renamed if the new meaning calls for it, matches on path boundaries, case-sensitively, with _ and % treated literally. Both callers use it.
Tests cover a sibling with the same leading characters, a different-case sibling, a name containing _ and %, and a directory argument with and without a trailing slash.
make check passes.
Model: fable-5-1 (audit); opus-5-5 (issue)
`FileRepository.ListByPrefix` (`internal/database/files.go:231-241`) selects with `path LIKE ? || '%'`. That is a plain string prefix, not a path prefix. It is case-insensitive for ASCII, and any `_` or `%` in the argument acts as a wildcard. It has two callers:
- **Restore path arguments** (`internal/vaultik/restore.go:781-813`). Measured on `next` at `0700901`: asking for `.../doc/` also restored `doc2/b.txt`, `Doc3/c.txt` and `doc.txt.bak`. Cleaning the filter removes the trailing slash, so the slash does not help. The help text says only matching files and directories are restored.
- **The scanner's known-file load for a backup path** (`internal/snapshot/scanner.go:425`). Files from any other configured path that merely starts with this one are counted as deleted in the backup summary (the comparison is at `scanner.go:1913-1927`).
Acceptable: a path selects exactly that path and everything beneath it (`p` itself, or anything starting with `p/`), compared case-sensitively and with no wildcard characters.
## Definition of done
1. `ListByPrefix`, renamed if the new meaning calls for it, matches on path boundaries, case-sensitively, with `_` and `%` treated literally. Both callers use it.
2. Tests cover a sibling with the same leading characters, a different-case sibling, a name containing `_` and `%`, and a directory argument with and without a trailing slash.
3. `make check` passes.
Model: fable-5-1 (audit); opus-5-5 (issue)
clawbot
self-assigned this 2026-10-06 01:49:44 +02:00
Reproduced on next at d276d89 with a failing test, then fixed in #250. A path now lists the file at that path and everything beneath it, compared case-sensitively and with _ and % taken literally.
Model: opus-5-5
Reproduced on `next` at `d276d89` with a failing test, then fixed in https://git.eeqj.de/sneak/vaultik/pulls/250. A path now lists the file at that path and everything beneath it, compared case-sensitively and with `_` and `%` taken literally.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
FileRepository.ListByPrefix(internal/database/files.go:231-241) selects withpath LIKE ? || '%'. That is a plain string prefix, not a path prefix. It is case-insensitive for ASCII, and any_or%in the argument acts as a wildcard. It has two callers:internal/vaultik/restore.go:781-813). Measured onnextat0700901: asking for.../doc/also restoreddoc2/b.txt,Doc3/c.txtanddoc.txt.bak. Cleaning the filter removes the trailing slash, so the slash does not help. The help text says only matching files and directories are restored.internal/snapshot/scanner.go:425). Files from any other configured path that merely starts with this one are counted as deleted in the backup summary (the comparison is atscanner.go:1913-1927).Acceptable: a path selects exactly that path and everything beneath it (
pitself, or anything starting withp/), compared case-sensitively and with no wildcard characters.Definition of done
ListByPrefix, renamed if the new meaning calls for it, matches on path boundaries, case-sensitively, with_and%treated literally. Both callers use it._and%, and a directory argument with and without a trailing slash.make checkpasses.Model: fable-5-1 (audit); opus-5-5 (issue)
Reproduced on
nextatd276d89with a failing test, then fixed in #250. A path now lists the file at that path and everything beneath it, compared case-sensitively and with_and%taken literally.Model: opus-5-5