Skip to content

chore(tui): name windows::core::BOOL and drop the direct windows-core dependency - #6390

Merged
Hmbown merged 1 commit into
mainfrom
fix/windows-core-bool-6359
Sep 21, 2026
Merged

Hmbown merged 1 commit into
mainfrom
fix/windows-core-bool-6359

Conversation

@Hmbown

@Hmbown Hmbown commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Supersedes Dependabot's #6359 (windows-core 0.62.2 → 0.100.0) by removing
the direct dependency instead of bumping it.

Why the dependency was never needed

crates/tui/Cargo.toml carried a direct windows-core = { version = "0.62" }
with a comment claiming the windows crate "re-exports most of windows-core's
types but not all of them (BOOL, HRESULT, … live in windows-core itself)".

That comment is wrong, and the repository already disproves it:
crates/tui/src/plugins/registry.rs:2203 does use windows::core::{BOOL, PCWSTR}; and compiles on the Windows CI lane today.

So window_control.rs now names windows::core::BOOL like its neighbour, the
direct dependency and its incorrect comment come out of Cargo.toml, and
Cargo.lock loses exactly one "windows-core", edge under codewhale-tui.
The crate is still built — transitively, via windows — so this changes no
build work and no behaviour. Dependabot's bump then has nothing to target.

Evidence

  • No windows_core:: references remain anywhere under crates/.
  • Cargo.lock delta is one line; cargo metadata --locked exits 0.

Unverified locally, by construction: this code is
cfg(target_os = "windows") and cannot be compiled on macOS. The Windows CI
lane on this PR is the compile receipt — it is the only proof that matters
here, and it has not run yet at the time of writing.

🤖 Generated with Claude Code

No-Issue: dependency cleanup. It supersedes Dependabot's PR #6359 by removing the dependency rather than bumping it; whether to close that PR is a separate maintainer decision, so no closing keyword is used here.

… dependency

crates/tui declared windows-core as a direct dependency for one import:
window_control.rs named `windows_core::BOOL` for the EnumWindows callback.
The manifest comment said `windows` does not re-export BOOL, but it does:
plugins/registry.rs in this same crate already imports
`windows::core::{BOOL, PCWSTR}` and compiles on the Windows lane.

The separate pin is what broke dependabot's #6359. It bumped windows-core to
0.100 while `windows` stayed at 0.62, so the callback's BOOL (windows-core
0.100) no longer matched the BOOL that `windows` 0.62's EnumWindows expects
(windows-core 0.62): E0308 on the Windows compile. Naming the type through
`windows` keeps a single windows-core in the graph, chosen by `windows`.

Validation: `cargo metadata --locked` exits 0 and the Cargo.lock delta is
the single removed `windows-core` edge under codewhale-tui. The changed code
is cfg(windows) and cannot be compiled on the macOS host, so the Windows CI
lane is the compile receipt for this change.

Supersedes #6359

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Hmbown
Hmbown marked this pull request as ready for review September 21, 2026 18:48
Copilot AI lite review requested due to automatic review settings September 21, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@claude

claude Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 44s —— View job


Claude finished reviewing this PR

Todo list

  • Gather context (diff, changed files, CLAUDE.md rules)
  • Verify no remaining windows_core:: references
  • Check window_control.rs change for correctness
  • Check Cargo.toml / Cargo.lock diff consistency
  • Post review

Summary

This is a clean, minimal dependency cleanup — verified against the ponytail rung 2 rule ("already in this codebase? reuse it"), which is exactly the case here.

Correctness

  • crates/tui/src/tui/window_control.rs:59: use windows_core::BOOL; → use windows::core::BOOL;. The sibling import at crates/tui/src/plugins/registry.rs:2203 (use windows::core::{BOOL, PCWSTR};) already proves this path compiles on the Windows lane, so this isn't a speculative change.
  • crates/tui/Cargo.toml: removed the direct windows-core = { version = "0.62" } dependency and its now-incorrect comment. Confirmed no other windows_core:: references remain anywhere under crates/ (grepped the whole tree).
  • Cargo.lock: the delta is exactly the single "windows-core", edge under codewhale-tui's dependency list (line 1224 area) — matches the PR description precisely. windows-core itself remains in the lockfile as a transitive dependency (still resolved via windows and other crates), so nothing is actually removed from the build graph — only the redundant direct pin is gone.
  • This directly fixes the root cause of dependabot PR chore(deps): bump windows-core from 0.62.2 to 0.100.0 in the windows group #6359's failure: two independently-versioned pins (windows at 0.62, windows-core bumped to 0.100) produced mismatched BOOL types for the EnumWindows callback (E0308). Routing through windows::core::BOOL ties the type to whatever windows-core version windows itself resolves, eliminating the version-skew class of bug entirely.

Scope

  • Change is cfg(windows)-gated only; nothing observable changes on non-Windows targets. No behavior change, no build-work change (dependency was already pulled in transitively).
  • Matches this repo's contract: "Rung 2 is the one this repository keeps failing" — this PR is a textbook example of correctly applying it (found the existing windows::core::BOOL usage, reused it, deleted the redundant direct dependency) rather than adding a new abstraction.

Provider/model/route safety, reuse, tests, security — not applicable; this is a Windows-only build dependency fix touching no provider/model/routing logic and no test-relevant behavior.

Verification note: as the PR body states, this code is cfg(target_os = "windows") and cannot be compiled on this (Linux) CI runner — the Windows CI lane is the actual compile receipt and should be checked before merge.

No issues found. Nice, well-scoped fix.

@codewhale-agent codewhale-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewhale review

Complete review coverage: 1/1 passes, 3 file patches, sha256:883c0dfae21bdaedcd1d8ef8294748c40e34af04bb97f26bdee11673cdb6faa5.

Pass 1: This pass removes the direct windows-core dependency from crates/tui/Cargo.toml, drops the now-unnecessary "windows-core", edge from the codewhale-tui entry in Cargo.lock, and switches crates/tui/src/tui/window_control.rs from use windows_core::BOOL; to use windows::core::BOOL;. The path change is type-identical: windows::core re-exports windows_core, so windows::core::BOOL resolves to the same type that EnumWindows's WNDENUMPROC expects, and the neighbouring Windows code already uses windows::core imports. The removed manifest stanza was a target-gated (cfg(target_os = "windows")) dependency; windows-core remains in the graph transitively through windows, so no consumer loses the crate. Source inspection found no defect introduced by these three edits.

Assessment

Pass 1: No defect identified in the diff. The change is a dependency-graph and path-alias cleanup: windows::core::BOOL and windows_core::BOOL are the same type reached through the windows crate's unconditional core re-export, so the EnumWindows callback signature in window_control.rs is unaffected, and the Cargo.lock edit removes exactly the direct edge that the manifest change makes stale while leaving the transitive windows-core package resolved. Two limits on this assessment are worth stating explicitly rather than treating as findings. First, this module is #[cfg(windows)], so none of it is compiled on a non-Windows host; whether the head actually builds the Windows lane is not established by this review (no build, test or cargo metadata --locked run was performed here). The relevant risk would be a remaining windows_core:: reference elsewhere in the crate that the removed dependency had been satisfying — the diff changes only the one site visible here, and the reviewers' own search claim cannot be independently confirmed from the supplied excerpts, since crates/tui/src/plugins/registry.rs and the rest of the crate were not included. If such a reference existed, the failure would be a Windows-only unresolved-crate compile error, which the Windows CI lane would surface. Second, the exact contents of the omitted manifest tail (lines 162-164 of the head) were not shown; the diff hunk header is consistent with the file ending at the windows = { version = "0.62", ... } line, and the removal leaves that entry intact. Neither point is evidence of a bug; both are verification gaps.


Advisory review by Codewhale (codewhale review --pr 6390 --post, head a5bc6b845d65fbf1ace5307bfd9005469dce629c). Line-specific findings are also posted as inline review comments; mechanical fixes arrive as committable suggestions you can apply from the Files tab. CODEOWNERS approval still governs merge.

@Hmbown
Hmbown merged commit 9990d3e into main Sep 21, 2026
38 of 39 checks passed
@Hmbown
Hmbown deleted the fix/windows-core-bool-6359 branch September 21, 2026 19:32
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.

2 participants