Skip to content

Take the latest version from the index, and prove a folder is a version - #12

Merged
TecharyJames merged 1 commit into
mainfrom
fix/canonical-prefix-match
Sep 19, 2026
Merged

TecharyJames merged 1 commit into
mainfrom
fix/canonical-prefix-match

Conversation

@TecharyJames

Copy link
Copy Markdown
Member

Microsoft.Office could not be installed at all. manifests/m/Microsoft/Office contains 2010 — not a release, but the Microsoft.Office.2010.* package namespace. Numeric sorting ranked 2010 above 16.0.20228.20124, so resolution looked for an installer manifest inside it and failed.

Paired with a detection service this does not fail once, it loops: detection correctly reports not installed, install fails, the pair repeats every scan. Observed continuously on a production endpoint:

GitHub Scraping Failed: No installer YAML found for 'Microsoft.Office' 2010.
Not found in GitHub (Microsoft.Office). Checking Custom Catalog...
Application 'Microsoft.Office' not found in GitHub OR Custom Catalog.

Changes

The version comes from the index. It already carries winget's own packages.latest_version — authoritative rather than inferred, and it removes one of the two API calls per resolve.

A folder is only a version if it contains an installer manifest. Where there is no index entry the directory listing is still used, but candidates are walked in order until one proves out, bounded to five probes since each is an API call. The error now names every candidate tried rather than only the first.

The earlier ^\d guard stays but was never sufficient — it rejects x86 and Canary, and cannot reject 2010.

Verification

Against the live repository:

Microsoft.Office  -> v16.0.20228.20124
Discord.Discord   -> v1.0.9258
Google.Chrome     -> v153.0.8010.53
Valve.Steam       -> v2.10.91.91
Git.Git           -> v2.55.0.3

Microsoft.Office could not be installed at all. manifests/m/Microsoft/Office
contains "2010", which is not a release but the Microsoft.Office.2010.*
package namespace. Sorting numerically ranked 2010 above 16.0.20228.20124,
resolution looked for an installer manifest inside it, and the failure
surfaced to the operator as "not found in GitHub OR Custom Catalog" for an
application that is published.

Paired with a detection service this does not fail once, it loops: detection
correctly reports not installed, the install policy fails, and the pair
repeats every scan. Observed continuously on STAR-S01003.

Two changes.

The version now comes from the detection index, which carries winget's own
packages.latest_version. That is authoritative rather than inferred, and it
removes one of the two API calls per resolve.

Where no index entry exists, the directory listing is still used, but a
folder is no longer assumed to be a version because it sorts highest. The
candidates are walked in order until one actually contains an installer
manifest, bounded to five probes because each is an API call. The error now
names every candidate tried instead of only the first.

The earlier ^\d guard is kept but was never sufficient: it rejects "x86" and
"Canary", and cannot reject "2010".

Verified against the live repository: Microsoft.Office resolves to
16.0.20228.20124, Discord.Discord to 1.0.9258, Google.Chrome to
153.0.8010.53, Valve.Steam to 2.10.91.91 and Git.Git to 2.55.0.3.
@TecharyJames
TecharyJames merged commit 8b00a83 into main Sep 19, 2026
1 check passed
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.

1 participant