feat(scanner): expose usage freshness status (#3577)

* feat(scanner): expose usage freshness status

* fix(scanner): reset dirty usage cycle state

---------

Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
This commit is contained in:
Henry Guo
2026-06-18 21:14:55 +08:00
committed by GitHub
parent 5d9fee5c0c
commit 80144ec886
6 changed files with 291 additions and 24 deletions
+17 -2
View File
@@ -70,8 +70,23 @@ fn materialize_object(base: String, extra: &str, flags: &[String]) -> String {
fn has_dot_segments(path: &str) -> bool {
path.split(['/', '\\']).any(|segment| {
let trimmed = segment.trim();
trimmed == "." || trimmed == ".."
let mut bytes = segment.as_bytes();
// Match ecstore's path-component check. `str::trim()` also trims
// Unicode whitespace such as vertical tab, which would reject object
// keys that the production validator accepts as ordinary path bytes.
while let Some((first, rest)) = bytes.split_first()
&& first.is_ascii_whitespace()
{
bytes = rest;
}
while let Some((last, rest)) = bytes.split_last()
&& last.is_ascii_whitespace()
{
bytes = rest;
}
bytes == b"." || bytes == b".."
})
}