# test: skip POSIX mode-bit assertions on a Windows host · PR \#9571 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/9571)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: windows-tests/mode-bits

Target branch: windows-tests/git-fixtures

Head commit: af43ec9288c60f8309c7a38bd31d57117ac3a95d

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/9571)

[Commits](https://git.cafe/pingdotgg/t3code/pull/9571/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/9571/diffs?format=markdown)

## Description

---

Several tests force a failure with chmod (0o555 directory, 0o000 file) or
assert exact 0o600/0o755 mode bits. NTFS has no POSIX modes: chmod on a
directory is a no-op, a file cannot be made unreadable, and stat reports
0o666. The write these tests expect to fail succeeds, so the assertion
inverts. Skip them where the host is Windows; the win32 code paths under
test already bypass the mode check.

Also skip the RotatingFileSink over-long-name test there, where the OS
reports ENOENT rather than ENAMETOOLONG and the sink's missing-file
handling is what runs.

Part of the Windows test-suite stack rooted at [#9564](https://github.com/pingdotgg/t3code/pull/9564); the manual Windows lane comes from [#9538](https://github.com/pingdotgg/t3code/pull/9538).

Model: Claude Fable 5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Test-only changes with no runtime behavior; reduces false failures on Windows CI without altering application logic.
> 
> **Overview**
> Makes the test suite reliable on **Windows** by gating or skipping cases that depend on POSIX `chmod` semantics and mode bits, which NTFS does not honor the same way.
> 
> **`t3-sqlite-state`**: The backup file `0o600` mode check runs only when `HostProcessPlatform` is not `win32`.
> 
> **Theme CLI, keybindings, relay client**: Tests that simulate write/read failures via `chmod` on directories or settings files are wrapped in `it.effect.skipIf(windowsHost)` (or equivalent), with comments explaining that Windows ignores directory chmod and cannot make files unreadable. The symlink rollback test also skips on Windows when chmod is involved.
> 
> **`RotatingFileSink`**: The over-long path test expecting `ENAMETOOLONG` is skipped on Windows, where the OS reports `ENOENT` and the sink treats the path as a missing file.
> 
> **Relay client**: Linux-path tests that set `0o755` and assert POSIX exec resolution are skipped on a win32 host, while checksum rejection and other non-mode tests remain.
> 
> No production code changes—only test harness adjustments using `HostProcessPlatform.defaultValue()` or Effect’s `HostProcessPlatform` service.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit af43ec9288c60f8309c7a38bd31d57117ac3a95d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Skip POSIX mode-bit assertions on Windows host in `t3-sqlite-state` test
> Guards the backup-file POSIX mode assertion so it runs only when the host platform is not `win32`. NTFS does not report POSIX mode bits, which caused the test to fail on Windows. The test still asserts mode `0o600` on non-win32 hosts.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized af43ec9.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->

