Skip to content

winget driver: version and installed match the id case-sensitively against winget's output, so an installed package reads as absent and every install "did not reach the requested state" #900

Closed

Description

@David-Noble-at-work

names are ids only; the failure quotes stderr while winget reports on stdout).

The defect

bracket (pkg/platform/helpers.go) decides an install from the post-state query alone. The winget leaf's query,
version (pkg/platform/windows_managers_windows.go:240), runs winget list --id <id> -- which winget matches
case-insensitively -- and then scans stdout for a line that strings.Contains the id case-sensitively. Winget prints
the catalog's casing. installed (:174) has the identical strings.Contains.

Measured on DANOBLE-WD11-3, 2026-09-21, build ad2219ef, deploying the personal layer's
Home/common.Windows/packages-manifest.yaml, which names pkg:winget/Vim/Vim?scope=machine (token Vim.Vim):

pkg.install-1: pkg.install: platform: winget/Vim did not reach the requested state (post=""):

and, the query the driver ran, verbatim:

$ winget list --id Vim.Vim
Name                           Id      Version  Source
-------------------------------------------------------
Vim 9.2 (ARM64) (current user) vim.vim 9.2.1119 winget
exit=0

Vim is installed; grep -c "Vim.Vim" over that output is 0. The install did not fail (the message's empty tail is
winget's empty stderr); the parser failed to see the result. We are case-sensitive; winget is not.

Consequence

Any winget package whose catalog casing differs from the manifest's fails the post-check, and because the packages
subgraph runs before the file chains, the whole scope stops before its first file unit. On DANOBLE-WD11-3 that is what
kept #822's writ deploy … --conflict=replace from ever reaching file.mkdir.

The fix

The line-scan becomes a pure function in windows_managers.go (untagged, so it is tested on every leg): find the
line whose Id column equals the token under strings.EqualFold, return its Version column. version and installed
call it. Pinned by a table test on the captured listing above, plus a listing with two packages and one with none.

Acceptance

  • winget list output naming vim.vim satisfies a query for Vim.Vim; a listing without the id returns ""
  • installed and version share the one parser; a unit test per case runs on every CI leg
  • on DANOBLE-WD11-3, writ deploy common noblefactor-ops --conflict=replace gets past pkg.install-1

's lane 14, under the command line schedule
Ticked 2026-09-21. wingetListedVersion in pkg/platform/windows_managers.go (untagged); version and installed
in windows_managers_windows.go call it; windows_managers_test.go pins seven cases, the captured listing first. On
DANOBLE-WD11-3 at 06:02, build ad2219ef with the fix, writ deploy common noblefactor-ops --conflict=replace
passed the packages subgraph and deployed 56 links, exit 0. In lane 12's pull request.

Plan and design documents

Kind Document
Plan docs/plans/fix/822-mkdir-obeys-conflict.md
Design docs/architecture/3.5.4-file-provider.md
Design docs/architecture/3.4-platform-package-managers.md

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions