Skip to content

fix(file): rooted patterns are absolute in Find's scope check; two Windows test fixes - #400

Merged
David-Noble-at-work merged 1 commit into
developfrom
fix/file-windows-trio
Aug 13, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
fix/file-windows-trio

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

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

resolveFindRoot used filepath.IsAbs to decide whether a pattern's base escapes the scoped root. /etc is not IsAbs on Windows (no drive letter), so Find("/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.Rel errors on the volume mismatch and the outside-scope error reports correctly.

Unix is unchanged (IsAbs already catches /) — which is also why no Darwin-side mutation can prove this: the existing TestFind_AbsolutePatternOutsideScope_Errors is the pin, and CI's windows leg is where it bites.

The two test fixes

Expected windows-leg effect: the surviving makePath panic clears (plus whatever its binary abort was hiding), and the Find-scope and ConvertFrom failures with it.

Verified: make vet, make lint-all, full make test green; gofmt clean.

…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 David-Noble-at-work self-assigned this Aug 13, 2026
@David-Noble-at-work
David-Noble-at-work merged commit f8e2052 into develop Aug 13, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/file-windows-trio branch August 13, 2026 05:22
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant