Repository navigation
fix(file): rooted patterns are absolute in Find's scope check; two Windows test fixes - #400
Merged
Merged
Conversation
…ix two Windows test expectations Three file-package items from the Windows remainder (#373 phase 3e), one of them a product defect. The defect: resolveFindRoot used filepath.IsAbs to decide whether a Find pattern's base escapes the scoped root. A rooted-but-driveless form ("/etc") is not IsAbs on Windows, so it took the relative branch and silently walked <scope>/etc instead of erroring — the scope-confinement contract violated for exactly the pattern shape ("/etc/**/*.conf") the confinement exists to refuse. Any rooted form now takes the absolute branch; filepath.Rel then errors on the volume mismatch and the outside-scope error reports correctly. Unix behavior is unchanged (IsAbs already catches "/"), which is also why no Darwin-side mutation can prove the fix: the existing TestFind_AbsolutePatternOutsideScope_Errors is the pin, and CI's windows leg is where it bites. The two test fixes: TestDiscoverRegular_WindowsShapedPath_IsAPath fed a literal D:\ path against a C: temp root — cross-volume, unmakeable relative, panic; it now borrows the fixture root's own volume on Windows while Unix keeps the literal "D:" shape, same treatment as its git-package twin (#392, PR #398). TestRegularConvertFrom_Unlinked asserted a slash literal against Abs, which is OS-native by the #377 ruling; the expectation is now filepath.FromSlash-built. Expected windows-leg effect: the surviving makePath panic clears (and with it whatever that panic's binary abort was hiding), plus the Find-scope and ConvertFrom failures. Verified: make vet, make lint-all, full make test green — zero FAIL or panic lines by count; gofmt clean. Issues: #373, #392
David-Noble-at-work
added a commit
that referenced
this pull request
Aug 13, 2026
…401) The burn-down ledger through PR #400: 85 -> 57 -> 48 -> 50 -> 48, the two rises being unmaskings — a panic aborts a package's whole test binary, and clearing panics lets more tests run. As of #400's leg there are zero panics on Windows, so 48 is the campaign's first fully honest count. The 48 decompose to named owners: 18 handle-leak failures under #393 — diagnosed to unclosed confined-Root directory handles (pre-Run error paths mint Roots no Run ever closes; the resume family rebuilds environments around a Root the first Run already closed) and ruled 2026-08-13: the executor owns the Root from construction, closes at every terminal state, and resume re-mints a fresh Root at the same anchor, with implementation deferred to a fresh session carrying the full design on the issue. The remainder: ~25 write/path/chown semantics under phase 3e, one Starlark escape (#376), two CLI error-text expectations, and stray singles. Documentation only; no code changes. Issues: #373, #393 Co-authored-by: David Noble <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three file-package items from the Windows remainder (#373 phase 3e), one a product defect.
The defect: Find's scope check missed rooted patterns on Windows
resolveFindRootusedfilepath.IsAbsto decide whether a pattern's base escapes the scoped root./etcis notIsAbson Windows (no drive letter), soFind("/etc/**/*.conf")took the relative branch and silently walked<scope>/etc— the confinement contract violated for exactly the shape it exists to refuse. Any rooted form now takes the absolute branch;filepath.Relerrors on the volume mismatch and the outside-scope error reports correctly.Unix is unchanged (
IsAbsalready catches/) — which is also why no Darwin-side mutation can prove this: the existingTestFind_AbsolutePatternOutsideScope_Errorsis the pin, and CI's windows leg is where it bites.The two test fixes
TestDiscoverRegular_WindowsShapedPath_IsAPath— fed a literalD:\path against a C: temp root (cross-volume → panic, aborting the whole package's binary). Now borrows the fixture root's own volume on Windows; Unix keeps the literalD:shape. Same treatment as its git-package twin (test(git,encryption): anchor fixture roots at temp directories, not "/" #398).TestRegularConvertFrom_Unlinked— asserted a slash literal againstAbs, which is OS-native by the fsroot.Path.Rel() returns OS-native separators, making serialized documents and checksums platform-dependent #377 ruling; expectation nowfilepath.FromSlash-built.Expected windows-leg effect: the surviving
makePathpanic clears (plus whatever its binary abort was hiding), and the Find-scope and ConvertFrom failures with it.Verified:
make vet,make lint-all, fullmake testgreen; gofmt clean.