From 308fc77328d755b15c5dce5bb69c265888e017b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 18:20:18 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(test):=20the=20window=20guar?= =?UTF-8?q?d's=20walk=20skipped=20no=20dot-directory,=20so=20a=20scratch?= =?UTF-8?q?=20clone=20spoke=20for=20the=20tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `every_window_write_outside_set_window_is_named` walks the workspace root and skipped only `target`, `.git` and `vendor`. This root also holds `.delta/` -- a gitignored scratch area of clones and worktrees left by delta/A-B tooling -- and the walk descended into it, so the guard was RED on main for ten window writes inside a checkout nobody edits, with every reported path under `.delta/worktrees/rfykqt93k1f7/`. The noise was the smaller half. The same stale clone was also being counted toward the coverage floor, so a foreign tree was propping up the assertion that exists to prove the walk reaches real source -- the guard could read a file or two of ours and still pass on the strength of a stranger's lines. Skipping every dot-directory rather than naming `.delta`: a dot-dir is by convention not part of the tree we make claims about, and the next scratch dir a tool drops here is then skipped by the same rule. Red before, green after, with `.delta` still on disk. Non-vacuity checked both ways: a real `s.out_us` write injected into `crates/engine/src/sweep.rs` turns the guard red on that path, and the file was restored byte-identically (sha256 36d00f17d595dedfaa0d087ab924e7117698e0527d48ac22fdd904cfffc1af91). The walk still reaches `crates/app` and now reads 86 files / 79,129 lines, which is what the floor's own comment already claimed. --- crates/engine/src/project.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/project.rs b/crates/engine/src/project.rs index 9892c67..0e4f2f4 100644 --- a/crates/engine/src/project.rs +++ b/crates/engine/src/project.rs @@ -11158,7 +11158,8 @@ mod tests { /// are cut. A test cannot produce a file a user loses, so the line is /// drawn there deliberately, not by omission. /// 4. **A file the walk does not reach**: a path outside `crates/`, or one - /// under a directory named `target`, `.git` or `vendor`. + /// under a directory named `target`, `.git`, `vendor`, or any + /// dot-directory (`.delta/` holds scratch clones of other checkouts). /// /// What the matcher DOES now cover, after four rounds of it not doing so: /// every assignment operator; struct-literal fields and the shorthand form, @@ -11370,9 +11371,25 @@ mod tests { let path = entry.path(); if path.is_dir() { // `target` is not source and `vendor` is not ours to rule on. - let skip = path - .file_name() - .is_some_and(|n| n == "target" || n == ".git" || n == "vendor"); + // + // Every DOT-directory, for the same reason and one more: a + // dot-dir is by convention not part of the tree we are + // making claims about. This workspace root holds `.delta/`, + // a scratch area of clones and worktrees left by delta/A-B + // tooling, and the walk used to descend into it and report + // the ten window writes inside a checkout that is not this + // one -- so the guard was RED here for a file nobody edits, + // and, worse, VACUOUS about its own tree: the same stale + // clone that produced the noise could have hidden a real + // offender behind it, and the floor below was being met in + // part by lines this guard has no business reading. Skipping + // the whole class rather than naming `.delta` is the point: + // the next scratch dir a tool drops here is skipped too. + let name = path.file_name().unwrap_or_default().to_string_lossy(); + let skip = name == "target" + || name == ".git" + || name == "vendor" + || name.starts_with('.'); if !skip { stack.push(path); }