-
Notifications
You must be signed in to change notification settings - Fork 905
fix(log-guard): accept the OS's own canonical spelling on Windows #2143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4dfc2d6
fix(log-guard): accept the OS's own canonical spelling on Windows
lidge-jun d2f1dcc
test(composed): show the child's output when a start never publishes …
lidge-jun 512d1c7
test(composed): scale the WP13 start watchdogs to the CI floor
lidge-jun fe8fc6f
ci(windows): give the Windows shards the timeout every other leg alre…
lidge-jun cf5f91e
test(composed): put the CLI output in the restore-back assertion message
lidge-jun b7b34a9
fix(windows): widen the identity-lookup budget on CI runners only
lidge-jun 9e11d4f
test(composed): pass CI through to the CLI children
lidge-jun d19a2c9
fix(log-guard): make the Windows path widening link-aware
lidge-jun c055608
test(composed): stop a timed-out case from killing the next one
lidge-jun 2b2190f
test(composed): route the last two hardcoded budgets through the CI s…
lidge-jun 3fa4053
docs(devlog): record the Windows leg, and the pre-existing verdict th…
lidge-jun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
91 changes: 91 additions & 0 deletions
91
devlog/_plan/260819_unclaimed_bug_selection/180_windows_leg.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # 180 — the Windows leg: five defects, and one I created | ||
|
|
||
| PR #2143. The Windows shards were red before this work and are less red after | ||
| it; this records what was actually wrong, because "Windows is flaky" was the | ||
| wrong answer four separate times. | ||
|
|
||
| ## The correction that matters most | ||
|
|
||
| I told the user twice that the Windows failures predated this release range. | ||
| The first half was true — the leg was red on `e446607c8` (2026-08-18). The | ||
| second half was not, and I stated it anyway. | ||
|
|
||
| **Log Guard is new in `main...dev`.** It has never worked on Windows. Every | ||
| mutation — protect, unprotect, repair, reclaim, compact — refused with | ||
| `unsafe_path`. Shipping this range without looking would have released a | ||
| feature that is broken on one of three platforms, and my own "pre-existing" | ||
| verdict is what nearly let it through. | ||
|
|
||
| The lesson is narrow and worth keeping: **"red before my change" and "not my | ||
| release's problem" are different claims.** A feature that landed on `dev` two | ||
| days earlier is still in the release. | ||
|
|
||
| Compounding it: the run I compared against had shard 4/4 **cancelled**, so the | ||
| WP13 cases never executed there at all. I read "no failures listed" as "passed". | ||
|
|
||
| ## What was actually wrong | ||
|
|
||
| | # | Defect | Where | Effect | | ||
| |---|---|---|---| | ||
| | 1 | `realpathSync.native` expands 8.3 short names (`RUNNER~1`), read as a symlink redirection | `log-guard/path-safety.ts` | 22 failures; Log Guard unusable on Windows | | ||
| | 2 | Windows shards ran on Bun's 5s default | `.github/workflows/ci.yml` | 3 failures on tests that had not hung | | ||
| | 3 | Test fixture's own `Bun.serve` used the default 10s idleTimeout | `codex-composed-acceptance.test.ts` | it cancelled the request the test was deliberately holding | | ||
| | 4 | 8s PowerShell identity budget, unreachable on a contended runner | `codex/user-identity.ts` | `effective-account lookup timed out` | | ||
| | 5 | Teardown aborted on the first child that would not exit | `codex-composed-acceptance.test.ts` | survivors killed by Bun's between-file sweep → the NEXT case failed with 143 | | ||
|
|
||
| Number 5 is why the failures looked like a moving target: one slow case was | ||
| being charged to unrelated ones. | ||
|
|
||
| ## The defect I introduced | ||
|
|
||
| My first fix for #1 re-canonicalized the requested path and compared the two | ||
| canonical forms. The caller already passes `realpathSync.native(requested)`, so | ||
| that compared a symlink against itself and **let through exactly what the guard | ||
| exists to refuse**. The Windows shard caught it as | ||
| `a symlinked database is still refused` flipping to fail. | ||
|
|
||
| Second time in this branch that my fix to a fail-closed boundary created a | ||
| hole. Both were caught by the platform leg rather than by me. | ||
|
|
||
| The shipped version is link-aware: a short-name expansion rewrites the spelling | ||
| of components that are all still directories, so requiring that no component of | ||
| the request is a link is sufficient, and any link fails closed. | ||
|
|
||
| ## Diagnostics were the actual unlock | ||
|
|
||
| Two rounds produced only `timed out waiting for runtime-port record`. That is | ||
| the symptom. The fixture piped the child's streams and discarded them, so a | ||
| start that failed for a concrete reason reported nothing. | ||
|
|
||
| Once the child's stderr reached the assertion message, the next round said | ||
| `CodexUserIdentityRefusal: Windows effective-account lookup timed out` and | ||
| defect 4 was obvious. Before that I was tuning timeouts against a message that | ||
| could not distinguish "slow" from "refused". | ||
|
|
||
| Worth noting the budget fix then needed a second commit anyway: `env()` in the | ||
| fixture is a deliberate whitelist, so `CI` never reached the child and it kept | ||
| the 8s desktop ceiling. | ||
|
|
||
| ## Result | ||
|
|
||
| | | before | after | | ||
| |---|---|---| | ||
| | shard 3/4 | failure | **success** | | ||
| | Log Guard | 22 fail | **0** | | ||
| | 5s-default | 3 fail | **0** | | ||
| | identity lookup | 4 fail | **0** | | ||
| | WP13 | 6 fail | 3 fail | | ||
|
|
||
| ## What is still red, and why it is not this range | ||
|
|
||
| - **WP13 (3)** — zero commits in `main..dev`, and no Windows run has ever | ||
| executed them to completion. Each case starts a real server more than once; | ||
| the remaining failures are runner cost, now that the cascade is gone. | ||
| - **npm cache preflight (3)** — zero commits in `main..dev`. Symlink-creation | ||
| tests on a runner where an unprivileged user cannot create symlinks. | ||
| - **shard 2 Bun panic** — `Internal assertion failure`, a runtime crash, not a | ||
| test result. | ||
|
|
||
| Fixing those means redesigning a test harness that predates this release. That | ||
| is a real piece of work and it is not this one. | ||
|
|
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.