Skip to content

test(cli): compare State Root locations with the platform separator - #4471

Closed
Astro-Han wants to merge 1 commit into
mainfrom
fix/qualify-state-root-windows-paths
Closed

test(cli): compare State Root locations with the platform separator#4471
Astro-Han wants to merge 1 commit into
mainfrom
fix/qualify-state-root-windows-paths

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

durable state covers the control namespace, not only the State Root compared durableStateLocations() output against POSIX string literals while the function itself builds paths with path.join. On Windows those disagree — join('/qualification-scope', 'state-root') is \qualification-scope\state-root — so the equality assertion was always false, npm run check:release failed, and with it the Windows packaging job that runs it.

The nesting guard in the same block carried the same assumption: on Windows no golden path can start with `${live}/`, so it passed vacuously and proved nothing. Both now use the platform's own separator.

The defect stayed latent on main because Release Windows check only runs when a pull request touches the release packaging inputs, and this test file is not one of them. It surfaced on #4468, which does touch them.

Refs #4427

Verification

  • node --test --test-concurrency=1 scripts/qualify-released-cli-state-root.test.mjs — 8/8 pass.
  • biome check scripts/qualify-released-cli-state-root.test.mjs — clean.
  • Windows itself is not reachable locally; the failing signal is the job log on feat(desktop): ship macOS x64 and Linux packages #4468 (scripts\qualify-released-cli-state-root.test.mjs:195, actual: false), and path.win32.join('/qualification-scope', 'state-root') returning \qualification-scope\state-root is what makes that assertion false. This PR does not trip Release Windows check either, so the end-to-end confirmation comes from rebasing feat(desktop): ship macOS x64 and Linux packages #4468 onto it.

Root cause

A test asserted on path syntax instead of on the path constructor the code under test uses.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code isolated the failure from the CI log and wrote the change. The contributor reviewed the diff and the reasoning.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

`durable state covers the control namespace, not only the State Root`
built its expectations with POSIX literals while the code under test
builds paths with `path.join`. On Windows the two disagree: `join`
returns `\qualification-scope\state-root`, so the equality assertion was
always false and `npm run check:release` — which the Windows packaging
job runs — failed there.

Build the expected State Root with the same `join` the production code
uses, and separate the nesting guard with `path.sep`. That guard had the
same POSIX assumption: on Windows no golden path can start with
`<live>/`, so it passed vacuously and proved nothing.

The defect stayed latent because `Release Windows check` only runs when
a pull request touches the release packaging inputs, and this test file
is not one of them.

Generated-by: Claude Code
@Astro-Han

Copy link
Copy Markdown
Contributor Author

Duplicate of #4461, which already carries the identical fix. Closing.

@Astro-Han Astro-Han closed this Sep 1, 2026
@Astro-Han
Astro-Han deleted the fix/qualify-state-root-windows-paths branch September 1, 2026 12:20
@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant