fix(windows): correct file operations and core checks #64

Open
Anarkkie wants to merge 6 commits from Anarkkie/LongshotLauncher:fix/windows-filesystem-checks into main
First-time contributor

The Windows core runner exposes real filesystem failures: concurrent atomic replacements can fail with access denied, and adding a separator to an existing drive root makes free-space detection fall back. This fixes those Windows paths and writes, and makes the cross-platform test fixtures state their platform requirements accurately.

Changes

  • Serialize only the final Windows AtomicFile rename with a named mutex derived from the normalized, case-folded destination. Temporary writes and flushes remain independent. Abandoned ownership recovers; genuine locked-file errors still propagate with the old bytes intact and temporary files removed.
  • Preserve a Windows drive root's existing separator in Disk.Within, so free-space lookup uses C:\ rather than a doubled separator.
  • Validate a Linux AppImage path with Linux absolute-path semantics even when the caller runs on Windows.
  • Report successful symlink fixtures as unavailable when Windows lacks the privilege; run them fully on Linux. Ordinary extraction, traversal rejection and prohibited-link rejection remain covered on Windows. No machine privilege setting changes.
  • Use the existing quoting contract for native Windows paths in the authored Linux shortcut fixture, retaining its independent escaping vectors.

These are separate commits within the Windows correctness topic, so the runtime fixes and fixture changes can be reviewed independently. No retry loop hides permission errors.

Reproduction and validation

Code a8f320e, based on main 01f2797; it applies cleanly to current main 9b3d202. The accompanying documentation commit adds the measured configurations without changing code.

Check Result
Windows four-process reproduction, 100 writes each Existing final replacement: 26 access-denied failures; evaluated File.Replace alternative: 71; named-mutex final rename: 0. Correctness comparison, not a performance benchmark.
Production atomic-write regression checks Four synchronized child processes, 64 writes each, absent and existing destinations: 512 writes. Case aliases, abandoned owner with a surviving handle, release checked from a different process, and a genuine locked destination all pass.
Windows 11 Pro 10.0.26300 / .NET 10.0.404 Strict full core 960 checks pass; independently repeated successfully.
Local Linux container / .NET 10.0.404 Strict core 985 checks and release tooling 28 tests pass, including successful links.
Locked Release builds, both platforms 0 warnings, 0 errors.

The Windows successful-link capability skip is explicit in output. Linux release tests emit existing Python socket ResourceWarnings but pass. docs/tested-configurations.md records the runs and their limits.

The private integration of these fixes with #55 and the root-layout fix in #63, on main 9b3d202, also passes Windows/Linux core 1,120 / 1,145, headless UI 290 / 289 and Linux release 28. These larger totals are combined validation, not this branch's standalone counts. Native Early -> Upgraded -> Early player routing passed in that integration; this PR itself changes no renderer or gameplay behavior.

Boundaries

The mutex coordinates ordinary normalized paths within one Windows session, following the existing InstanceLock convention. It does not promise coordination through arbitrary aliases, across sessions or across machines. Linux retains its existing atomic-replacement behavior. No UI layout or new default is introduced.

Open #54 also touches SelfUpdate.CurrentFile for package start paths. This change preserves its existing contract and should be kept when resolving merge order with that proposal.

AI-assisted implementation and independent source review with OpenAI Codex. Tests use authored files and processes; no game data is included.

The Windows core runner exposes real filesystem failures: concurrent atomic replacements can fail with access denied, and adding a separator to an existing drive root makes free-space detection fall back. This fixes those Windows paths and writes, and makes the cross-platform test fixtures state their platform requirements accurately. ## Changes - Serialize only the final Windows `AtomicFile` rename with a named mutex derived from the normalized, case-folded destination. Temporary writes and flushes remain independent. Abandoned ownership recovers; genuine locked-file errors still propagate with the old bytes intact and temporary files removed. - Preserve a Windows drive root's existing separator in `Disk.Within`, so free-space lookup uses `C:\` rather than a doubled separator. - Validate a Linux AppImage path with Linux absolute-path semantics even when the caller runs on Windows. - Report successful symlink fixtures as unavailable when Windows lacks the privilege; run them fully on Linux. Ordinary extraction, traversal rejection and prohibited-link rejection remain covered on Windows. No machine privilege setting changes. - Use the existing quoting contract for native Windows paths in the authored Linux shortcut fixture, retaining its independent escaping vectors. These are separate commits within the Windows correctness topic, so the runtime fixes and fixture changes can be reviewed independently. No retry loop hides permission errors. ## Reproduction and validation Code `a8f320e`, based on main `01f2797`; it applies cleanly to current main `9b3d202`. The accompanying documentation commit adds the measured configurations without changing code. | Check | Result | |---|---| | Windows four-process reproduction, 100 writes each | Existing final replacement: **26 access-denied failures**; evaluated `File.Replace` alternative: **71**; named-mutex final rename: **0**. Correctness comparison, not a performance benchmark. | | Production atomic-write regression checks | Four synchronized child processes, 64 writes each, absent and existing destinations: **512 writes**. Case aliases, abandoned owner with a surviving handle, release checked from a different process, and a genuine locked destination all pass. | | Windows 11 Pro 10.0.26300 / .NET 10.0.404 | Strict full core **960 checks** pass; independently repeated successfully. | | Local Linux container / .NET 10.0.404 | Strict core **985 checks** and release tooling **28 tests** pass, including successful links. | | Locked Release builds, both platforms | **0 warnings, 0 errors**. | The Windows successful-link capability skip is explicit in output. Linux release tests emit existing Python socket ResourceWarnings but pass. `docs/tested-configurations.md` records the runs and their limits. The private integration of these fixes with #55 and the root-layout fix in #63, on main `9b3d202`, also passes Windows/Linux core **1,120 / 1,145**, headless UI **290 / 289** and Linux release **28**. These larger totals are combined validation, not this branch's standalone counts. Native Early -> Upgraded -> Early player routing passed in that integration; this PR itself changes no renderer or gameplay behavior. ## Boundaries The mutex coordinates ordinary normalized paths within one Windows session, following the existing `InstanceLock` convention. It does not promise coordination through arbitrary aliases, across sessions or across machines. Linux retains its existing atomic-replacement behavior. No UI layout or new default is introduced. Open #54 also touches `SelfUpdate.CurrentFile` for package start paths. This change preserves its existing contract and should be kept when resolving merge order with that proposal. AI-assisted implementation and independent source review with OpenAI Codex. Tests use authored files and processes; no game data is included.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/windows-filesystem-checks:Anarkkie-fix/windows-filesystem-checks'
git switch 'Anarkkie-fix/windows-filesystem-checks'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!64
No description provided.