# PURL and VERS in Practice

Let me share my pain with you. I maintain libraries for Package URLs and VERS version ranges in Ruby ([purl](https://github.com/andrew/purl), [vers](https://github.com/andrew/vers)) and Go ([purl](https://github.com/git-pkgs/purl), [vers](https://github.com/git-pkgs/vers)), and [ecosyste.ms](https://ecosyste.ms) and [git-pkgs](https://github.com/git-pkgs) use them anywhere manifests, lockfiles, SBOMs, registry metadata and advisories have to be joined up. In theory the two specs make that kind of cross-ecosystem tooling easy. In practice there are more than forty package types, every one of them has its own rules for names, case, versions and ranges, and the specs cover some of those rules and leave the rest to me. Both specs are also still changing, so I'm chasing them as well as the ecosystems.

Pretty much every fix gets made twice, once per language, then checked against whatever the ecosystem's own tool does, and then checked again a few months later when the spec text or its test suite has moved. Everything in this post caught me out at least once, and I've linked the bug or spec thread where it happened. Hardly any of it failed loudly, either: most of these bugs returned a successful response with wrong or missing data in it, like an empty advisory list for a package that has advisories or a cache entry for a different package, and a scanner reads an empty list as clean.

A [Package URL](https://github.com/package-url/purl-spec), or purl, is a short string that identifies a package: `pkg:npm/%40babel/core@7.24.0` is version 7.24.0 of `@babel/core` on npm, and `pkg:deb/debian/curl@8.5.0-2?arch=amd64` is a Debian build of curl. [VERS](https://github.com/package-url/vers-spec) is the same project's notation for version ranges, where `vers:npm/>=1.2.0|<2.0.0` means every npm version from 1.2.0 up to but excluding 2.0.0. Purl is now an Ecma standard, [ECMA-427](https://tc54.org/purl/). CycloneDX and SPDX documents both include purls, the OSV API accepts them as queries. Syft and Trivy emit one for each package they detect.

## Encoding

Percent-encoding is the first thing to break in a new implementation, partly because the spec text changed. For seven years it contained both "may need to be encoded" and "is unambiguous unencoded everywhere" for a colon, and a [2025 survey in that thread](https://github.com/package-url/purl-spec/issues/39) found ten implementations writing `:` and four writing `%3A`. The current text leaves a colon unencoded everywhere and encodes every other separator when it appears as data, which makes a registry qualifier come out as `repository_url=https:%2F%2Fnpm.example.com`. My Go library writes that form, and my Ruby one [writes](https://github.com/andrew/purl/issues/86) `https://npm.example.com`, which the spec's grammar notes describe as "not canonical, but usable", so that older stored strings match. The spec's [OCI examples](https://github.com/package-url/purl-spec/blob/main/types/oci-definition.json) use both `sha256%3A` and `sha256:`.

Version 1.x of the Ruby gem decoded a literal `+` as a space the way HTML forms do, so `pkg:golang/github.com/docker/docker@v28.3.3+incompatible` was looked up as `v28.3.3 incompatible` and packages.ecosyste.ms reported it missing, along with Debian versions like `15.3-0+deb12u1` and the package `gtk+3.0`. The same release wrote qualifier values back raw. A stored `repository_url=git%2Bssh%3A%2F%2F...` was parsed correctly and re-serialized as `git+ssh://`, so the next read produced `git ssh://`, at which point a reindex in another service failed on a uniqueness constraint. The [fix](https://github.com/andrew/purl/pull/75) was a major version, and of 5,650 real purls I checked it against, ten changed.

The `@` sign separates name from version and also starts every npm scope, where the type definition requires it "always percent encoded" as `%40`. Plenty of real input has `pkg:npm/@babel/core`, the spec's test suite [contains passing cases](https://github.com/package-url/purl-spec/issues/865) written that way, and the reference parsing steps split on the last `@`, so `pkg:npm/@babel/core#lib` [reads `babel/core` as the version](https://github.com/package-url/purl-spec/issues/547). In Homebrew the formula `openssl@3` has to be written `pkg:brew/openssl%403`, because `pkg:brew/openssl@3` is version 3 of a formula called `openssl`. A strict parser rejects purls like `pkg:npm/@babel/core`, so both of my libraries accept those forms and write back the canonical one.

## Names

Each purl type has its own rules for what counts as the same name, written as free text in the type definition, and a parser that skips them produces well-formed strings that fail every lookup. PyPI names are compared after lowercasing and collapsing runs of `-`, `_` and `.` into a single dash. packages.ecosyste.ms stored `typing_extensions` as published while generating `pkg:pypi/typing-extensions` for it, so a lookup of the service's own purl [missed the package](https://github.com/ecosyste-ms/packages/issues/1825). My Ruby library folds `zope.interface` into `zope-interface` as the type definition requires, and my Go one [returns `zope.interface`](https://github.com/git-pkgs/purl/issues/69) from the parser because the upstream `packageurl-go` does.

NuGet names are case-insensitive, which the [type definition](https://github.com/package-url/purl-spec/blob/main/types/nuget-definition.json) records as `case_sensitive: true` next to the note "case-preserving, but case-insensitive". ecosyste.ms ended up with [four rows for `Newtonsoft.Json`](https://github.com/ecosyste-ms/packages/issues/674) before moving to lowercase storage.

Go module paths are case-sensitive, and the [golang definition](https://github.com/package-url/purl-spec/blob/main/types/golang-definition.json) has `case_sensitive: true` and, one line down, "The namespace shall be lowercased", which is what `packageurl-go` does. `github.com/Sirupsen/logrus` and `github.com/sirupsen/logrus` are different zips with different checksums on the module proxy, so when the [git-pkgs proxy](/2026/05/11/proxy.html) keyed its cache on the lowercased purl it served whichever was fetched first and `go` [failed the checksum](https://github.com/git-pkgs/proxy/issues/466) on the other.

The boundary between namespace and name [varies by type](/2026/02/14/package-management-namespaces.html) too: Maven joins group and artifact with a colon in its own tools and a slash in a purl. ecosyste.ms stores the colon form, and a client of mine that built lookup names by joining namespace and name with `/` for every type [got an empty result for every Maven package](https://github.com/ecosyste-ms/ecosyste_ms_cli/commit/f7875fd9dfd108866a783513ba65f4c4354041e5), advisory lists included. packages.ecosyste.ms built GitHub Actions purls from the first and last path segments of the name, which turned the nested actions `github/gh-aw/actions/setup` and `github/gh-aw-actions/setup` into [one purl](https://github.com/ecosyste-ms/packages/issues/1837). Docker Hub's official images have an implicit `library/` prefix, so `pkg:docker/python` and `pkg:docker/library/python` are the same image, and the lookup [found only the second](https://github.com/ecosyste-ms/packages/issues/626).

advisories.ecosyste.ms builds a purl from a stored name by passing the whole name through as the purl name, and its API currently [returns](https://github.com/ecosyste-ms/advisories/issues/1173) `pkg:go/github.com%2Fgorilla%2Fmux` where the correct purl is `pkg:golang/github.com/gorilla/mux`, and the SBOM export on repos.ecosyste.ms interpolates a string to get [`pkg:maven/org.hamcrest:hamcrest`](https://github.com/ecosyste-ms/repos/issues/1251) in place of `pkg:maven/org.hamcrest/hamcrest`. My Ruby gem [converts](https://github.com/andrew/purl/issues/84) `https://pkg.go.dev/github.com/gorilla/mux` to a golang purl with the whole path as its name, when the namespace should be `github.com/gorilla` and the name `mux`. For the advisories and repos cases I've proposed [a helper in the gem](https://github.com/andrew/purl/issues/85) that takes an ecosystem and a package name and splits it per type.

The swift type has two naming schemes in use: scanners and advisory databases write the source location, `pkg:swift/github.com/apple/swift-argument-parser`, while SwiftPM's own SBOM output for registry packages writes the registry identity, `pkg:swift/apple/swift-argument-parser`. OSV returns an empty list for the second form, and a vulnerability scanner [reports that as clean](https://github.com/git-pkgs/git-pkgs/issues/385). The Go library now distinguishes them by checking the namespace for a dot, and the [spec issue](https://github.com/package-url/purl-spec/issues/929) has been open since July 2026.

## Types

Every database already has [its own name](/2026/03/03/package-management-is-naming-all-the-way-down.html) for each ecosystem, and the purl type adds another:

| purl type | OSV | GitHub Advisories | packages.ecosyste.ms |
|---|---|---|---|
| `gem` | `RubyGems` | `rubygems` | `rubygems` |
| `pypi` | `PyPI` | `pip` | `pypi` |
| `cargo` | `crates.io` | `rust` | `cargo` |
| `golang` | `Go` | `go` | `go` |
| `composer` | `Packagist` | `composer` | `packagist` |
| `hex` | `Hex` | `erlang` | `hex` |
| `swift` | `SwiftURL` | `swift` | `swiftpm` |
| `githubactions` | `GitHub Actions` | `actions` | `actions` |

Every project of mine that handles purls contains a copy of this table, and the copies have diverged. The git-pkgs proxy stored one package under both `gem` and `rubygems` because [two code paths](https://github.com/git-pkgs/proxy/issues/415) used different tables. A wrong entry usually produces an empty result and a success status: the Grype database uses Syft's names (`go-module`, `rust-crate`, `java-archive`), so [seven ecosystems return empty results](https://github.com/git-pkgs/vulns/issues/64) through a table written with other names. An error can fail more than the one entry, as with OSV's batch endpoint, which returned a [400 for the whole batch](https://github.com/git-pkgs/git-pkgs/issues/276) when one ecosystem name was unrecognised. advisories.ecosyste.ms stores advisories under `packagist`, `hex`, `pub`, `actions` and `swift` (GitHub's name, where packages.ecosyste.ms uses `swiftpm`). Its table of eleven purl types omits all five, and a lookup by `pkg:composer/symfony/http-kernel` currently [returns a 400](https://github.com/ecosyste-ms/advisories/issues/1173).

People writing purls by hand use the registry's name, and `pkg:rubygems/rake@13.0.0`, `pkg:crates/serde` and `pkg:go/...` all parse as valid purls with unregistered types. Denylist entries written like that in the proxy config failed to match and the proxy served the blocked version, so it now [refuses them at startup](https://github.com/git-pkgs/proxy/pull/834). ecosyste.ms defaults the type to the registry's class name, which shipped `pkg:openvsx/...` for [Open VSX](https://github.com/ecosyste-ms/packages/issues/1918) when the registered type is `vscode-extension` with a `repository_url`. Both my libraries used `pkg:homebrew` before `brew` [was registered](/2026/07/17/plumbing-homebrew-into-the-vulnerability-ecosystem.html), and both accept it as an alias. Chef and Vagrant are unregistered, Helm's type has been an [open pull request](https://github.com/package-url/purl-spec/pull/236) since 2023, and for those my manifest parser returns an empty purl.

## Registries

A purl names a package within a type, and the type implies a default registry, so `pkg:npm/lodash` is lodash on registry.npmjs.org. Anything else is meant to carry a `repository_url` qualifier, which works only if both sides write the URL identically, and the spec's examples put `gcr.io`, with no scheme, [in that qualifier](https://github.com/package-url/purl-spec/issues/140). Maven Central is served from both `repo1.maven.org` and `repo.maven.apache.org`, and [whether the qualifier is needed](https://github.com/package-url/purl-spec/issues/303) for the one the spec lists as non-default is an open issue. Cargo's lockfile records the default index as a git URL, which my manifest parser [passed through as a qualifier](https://github.com/git-pkgs/git-pkgs/issues/309), and the ecosyste.ms registry lookup for that URL came back empty. Scanners routinely omit the qualifier, so a Trivy purl for an artifact hosted on a project's own Maven repository [gets looked up on Central](https://github.com/ecosyste-ms/packages/issues/1267) and returns 404.

Containers have two types: `pkg:docker` allows the registry host in the namespace, and `pkg:oci` forbids a namespace and puts the whole location in `repository_url`. Implementations [parse the overlap differently](https://github.com/package-url/purl-spec/issues/425), and in the proxy a pull checked as `pkg:oci` passes a denylist entry written for the same image as `pkg:docker`.

Distro packages put the distribution in the namespace (`pkg:deb/debian/openssl`) and the release in a `distro` qualifier that [appears only in the examples](https://github.com/package-url/purl-spec/issues/423) of the deb and rpm definitions. Trivy and syft write `debian-12` or `ubuntu-22.04`, package archives use codenames, and the translation is a [hand-maintained table](https://github.com/git-pkgs/registries/issues/143). A consumer that skips the qualifier gets [every release's advisories](https://github.com/git-pkgs/vulns/issues/70) for the package at once. The epoch is part of the version for deb and a [separate qualifier for rpm](https://github.com/package-url/purl-spec/issues/151), and real purls have it in the version, in the qualifier, or absent.

Scanners report binary packages (`libssl3`) while most indexes and advisories are keyed by source package (`openssl`). Syft bridges the two with an `upstream` qualifier, and a lookup that skips it [searches for `libssl3`](https://github.com/ecosyste-ms/packages/pull/1985) in an index keyed by `openssl`. A package installed from a third-party apt repository such as PGDG gets the same `pkg:deb/debian/...` purl as Debian's own build, so PGDG's build is [matched against Debian's advisories](https://github.com/ecosyste-ms/packages/issues/1981).

## Manifests

Lockfiles are full of entries that come from local paths, URLs and git checkouts, and a parser that mints a purl for each one sends them all to registry and advisory lookups. Before I added a flag marking an entry as having no purl, `deno.json` imports of local paths and URLs [became](https://github.com/git-pkgs/manifests/issues/116) `pkg:deno/.%2Fsrc%2Futils%2F` and `pkg:deno/node:fs`. [Git submodules](/2026/09/01/git-submodules-as-a-package-manager.html) were [named by their checkout path](https://github.com/git-pkgs/manifests/pull/129), and every package in an `renv.lock`, Bioconductor and GitHub sources included, [was given](https://github.com/git-pkgs/manifests/issues/123) a `pkg:cran` purl.

The same parser currently [gives](https://github.com/git-pkgs/manifests/issues/178) a `package.json` dependency on `file:../local-lib` the purl `pkg:npm/local-lib`, which identifies whatever package has that name on npmjs.org, and a package-lock entry for `lodash` installed under the alias `my-lodash` [comes out](https://github.com/git-pkgs/manifests/issues/177) as `pkg:npm/my-lodash`. A Gemfile.lock git remote is [written](https://github.com/git-pkgs/manifests/issues/179) into `repository_url`, the qualifier for an alternative gem server. A Cargo `[patch]` section or an npm `overrides` block (or `replace` in go.mod) [swaps the code](/2026/05/01/patching-and-forking-in-package-managers.html) that gets installed while the lockfile [records the registry's name and version](https://github.com/git-pkgs/manifests/issues/105).

A manifest declares a range where a purl has a version, and the version component is an opaque string, so `pkg:npm/lodash@^4.17.21` is a valid purl. One git-pkgs command built that purl and then derived the tarball URL [`lodash-^4.17.21.tgz`](https://github.com/git-pkgs/git-pkgs/issues/239) from it. The SBOM export on repos.ecosyste.ms [puts](https://github.com/ecosyste-ms/repos/issues/1251) `^7.19.6` in the CycloneDX `version` field. The spec provides a `vers` qualifier on a versionless purl for this, though what a versionless purl means on its own (the package in general, or all its versions) was [debated and moved to a discussion board](https://github.com/package-url/purl-spec/issues/257), where it is open. Dropping the version to get a map key [collapsed a lockfile](https://github.com/git-pkgs/git-pkgs/issues/345) with `debug@2.6.9` and `debug@4.3.4` to one entry.

A versioned purl maps to several files in some ecosystems, since `pkg:gem/nokogiri@1.16.0` covers a source gem and a precompiled gem [per platform](/2026/02/17/platform-strings.html), and a resolver that drops the `platform` qualifier turns `pkg:gem/jruby-launcher@1.1.2?platform=java` into [the URL of the ruby-platform gem](https://github.com/git-pkgs/registries/issues/142), which returns 403. My Gemfile.lock parser currently [strips the platform](https://github.com/git-pkgs/manifests/issues/180) from `nokogiri (1.16.5-arm64-darwin)` and reports the purl of the source gem.

## Equality

The standard requires that "equivalent PURLs are consistently resolved to the same canonical representation", and the definition of equivalent is [an open issue](https://github.com/package-url/purl-spec/issues/975). Qualifier order is only recommended, and whether unknown qualifiers count is [also open](https://github.com/package-url/purl-spec/issues/622). Several of the per-type rules (NuGet case, Docker's `library/`, conda's channel appearing as namespace or qualifier) change stored data when applied to the canonical string. String comparison reports two NuGet names that differ only in case as different packages, and two Go paths that differ only in case as the same package once lowercased.

A [pull request from simonchrz](https://github.com/git-pkgs/purl/pull/50) gave the Go library a second form: the stored purl is the canonical string it already produced, and a comparison form applies additional per-type folding rules and is used only as a key. `ComparisonForm` returns a copy of the purl with six per-type rules applied:

- PyPI names are lowercased and folded
- NuGet names and versions are lowercased
- a leading `v` is stripped from a Composer version, since Packagist stores the tag `v6.1.7` and Composer resolves it as `6.1.7`
- a conda channel written as a namespace or as `channel/name` moves into the `channel` qualifier
- an OCI namespace is joined onto the name
- a Swift registry identity is lowercased, while a source location such as `github.com/apple` is copied as written

Docker's `library/` prefix is [absent from the six](https://github.com/git-pkgs/purl/issues/70). The rules are applied in `ComparisonForm` alone, which equality checks and deduplication call, because callers have already stored the output of `Parse` and `String` as keys and a change there would orphan those rows.

The proxy had four separate implementations of "same package" in its denylist, cache, cooldown and mirror before they were [consolidated](https://github.com/git-pkgs/proxy/pull/589) onto it, and earlier it had written [two rows](https://github.com/git-pkgs/proxy/issues/207) for `Django` and `django`. In a database the comparison form needs its own column and index. A bulk lookup on packages.ecosyste.ms that OR-ed a normalised-name predicate for a hundred PyPI purls took [84 seconds](https://github.com/ecosyste-ms/packages/pull/1863), and 25 milliseconds once it was grouped by ecosystem.

The newer ecosyste.ms [purl lookup](https://github.com/ecosyste-ms/packages/pull/1806) returns one result per input, in order, marked `matched`, `missing` or `ambiguous`, because a bulk response keyed by the server's canonical purl omits every input that was spelled differently. On the advisories side, an empty list for a Debian build missing from the service's data [reads as a clean result](https://github.com/ecosyste-ms/advisories/issues/1150), and that issue is open.

## Versions

A purl version is an opaque string, and VERS has to order versions, because a range is defined by ordering. The VERS [type index](https://github.com/package-url/vers-spec/blob/main/vers-types-index.json) registers two schemes, npm and pypi. The [types document](https://github.com/package-url/vers-spec/blob/main/docs/types/vers-types.md) describes fifteen ecosystems in a sentence each, the type definition schema has [no field for comparison rules](https://github.com/package-url/vers-spec/issues/150), and the `generic` type uses an algorithm that "will be specified later", so each scheme's ordering has to be ported from the native tool.

Falling back to a semver-shaped comparator for everything is the mistake I made in both libraries, and it returns a wrong answer instead of an error. In the Go library `5.2b1` parsed as `5.0.0` because the integer conversion of `2b1` failed and the error was discarded, so `vers:pypi/<5.2b1|>=5.1` [contained `6.0.3`](https://github.com/git-pkgs/vers/issues/24). The same comparator read a RubyGems fourth segment as a prerelease (`1.0.0 > 1.0.0.1`) and put Maven's `1.0-sp1` below `1.0` when `sp` sorts above the release. It also parsed Debian's `1:2.3.4-1` as `0.3.4-1` and `1.0~rc1` as `1.0.0` ([all in one issue](https://github.com/git-pkgs/vers/issues/25)). Alpine had been delegated to the Gentoo comparator, which made `1.0_git` equal `1.0`, until I [ported the apk-tools tokenizer](https://github.com/git-pkgs/vers/pull/45), and Bazel's ordering is covered in [a separate post](/2026/08/27/bazel-module-versions-arent-semver.html).

Go module versions include a leading `v`, and OSV and GitHub advisories for Go omit it, which is an [open purl spec issue](https://github.com/package-url/purl-spec/issues/294), so a version copied from an advisory into a config file fails to match the `v`-prefixed version the module proxy serves. The Go vers library strips the `v` for other schemes, and a user converting distro advisories [reported](https://github.com/git-pkgs/vers/issues/60) rpm versions like openEuler's `v1.11.1-8.oe1`, where the `v` is part of the version and stripping it makes an exact range fail to contain its own version. In opam, `v0.17.0` is valid and sorts after every version that starts with a digit.

## Ranges

A vers string is a flat list of constraints separated by pipes, and the spec text is that the pipes "do not mean 'and' or 'or'". The list is sorted by version, and containment iterates over it, pairing each lower bound with the next upper bound, so `>=1.0.0|<2.0.0|>=3.0.0|<4.0.0` is two intervals, which [readers](https://github.com/package-url/vers-spec/issues/20) and implementers both get wrong. Since 2026 only the canonical form is valid, so unsorted or duplicated constraints [must be rejected](https://github.com/package-url/vers-spec/pull/65), and `vers:npm/=1.2.3` is an error because equality is written as a bare version. One required case in the spec's test vectors [repeats a version](https://github.com/package-url/vers-spec/issues/159), which the same rule rejects.

VERS has no way to write an empty range or a prerelease policy, and native ranges use both. npm's `1.1.2 1.2.2` (a space means AND, so its match set is empty) appears in advisory data. The upstream npm tests parsed a space as a union until [a fix in October 2026](https://github.com/package-url/vers-spec/pull/146), and my Go library matched those tests and emitted `vers:npm/1.1.2|1.2.2`, which matches two versions the original excludes; it now [returns a sentinel](https://github.com/git-pkgs/vers/pull/63) and the Ruby one raises. In npm and Composer a range like `<2.0.0` excludes `2.0.0-rc1` under rules that depend on how the range was written, and Elixir's `~> 0.1.5` excludes `0.2.0-alpha.7` while the interval it converts to, `>=0.1.5|<0.2.0`, [includes it](https://github.com/package-url/vers-spec/issues/49).

Operators that look alike mean different things across ecosystems, and the Ruby library first [rejected Cargo's comma form](https://github.com/andrew/vers/issues/37) while both libraries computed the wrong bounds for npm's tilde on [versions containing a zero](https://github.com/git-pkgs/vers/issues/8):

- `^0.0.3` is exactly `0.0.3` in npm and `>=0.0.3 <0.1.0` in Dart's pub
- a bare `1.2.3` is an exact version in npm and `^1.2.3` in Cargo
- a comma is AND in Cargo, PyPI and RubyGems, and a space is AND in npm
- PyPI's `~=1.4.5` and RubyGems' `~> 1.4.5` match the same versions until an epoch or a `.dev` segment is involved
- PyPI's `<2.0` excludes `2.0rc1` and `==1.0` matches `1.0+local`, so matching a specifier differs from comparing versions
- RubyGems' `~> 1.2` excludes `2.0.a`, and the Ruby library currently [includes it](https://github.com/andrew/vers/issues/53)
- a bare `1.0` in a Maven POM is a soft requirement that dependency mediation can replace

Compound requirements are open bugs in both libraries as I write this. The Ruby library [reads](https://github.com/andrew/vers/issues/52) the RubyGems requirement `~> 1.2, >= 1.2.5` as a single version, while the Go one parses it correctly and then [serializes](https://github.com/git-pkgs/vers/issues/71) every comparator as `vers:gem/>=1.2|>=1.2.5|<2`, which reparses as a range containing `5.0.0`. The Ruby library [serializes Hex's `and`](https://github.com/andrew/vers/issues/54) the same way. It also [accepts](https://github.com/andrew/vers/issues/57) the Go range `>= 1.0.0 < 2.0.0` as a single lower bound, so the range contains `3.0.0`; in advisory data that range has a comma. Maven's `[1.0,2.0],[3.0,4.0]` is a union of two ranges, and the Go library [returns](https://github.com/git-pkgs/vers/issues/70) one range whose upper bound is the string `2.0],[3.0,4.0`.

GitHub writes advisory ranges as `>= 1.0, < 2.0` for every ecosystem, which is valid native syntax in Cargo, PyPI and RubyGems and invalid in npm. When the Ruby library's parsers became stricter, a `rescue` around the conversion in advisories.ecosyste.ms turned each rejection into an empty affected-versions list, and most compound ranges [returned empty matches for about ten days](https://github.com/ecosyste-ms/advisories/issues/1106). Stored ranges consisting of an operator alone [parsed as unbounded](https://github.com/andrew/vers/pull/46) and flagged every release. An advisory range lists the versions that contain a bug and a manifest range lists the versions a resolver may install, so an advisory range includes prereleases that a package manager's matching rule skips. OSV's range for a Next.js advisory, `>=16.0.0|<16.3.3`, [excluded](https://github.com/git-pkgs/vers/issues/50) `16.3.0-canary.97` under npm's rule. An install should skip that version and a scanner should report it. The Ruby library has an `include_prerelease` option for this and the Go one has an open issue.

Ranges come from untrusted input, and a few thousand `!=` constraints ran for seconds in both libraries before [input](https://github.com/git-pkgs/vers/pull/64) [limits](https://github.com/andrew/vers/pull/20) went in. The Go library's Conan parser recurses on `1 - 2` until it [overflows the stack](https://github.com/git-pkgs/vers/issues/69), a fatal error in Go that ends the process.

## Tests

Both specs ship a test suite, and my libraries passed both with the bugs in this post present. Purl's moved from a single JSON file to per-type files in 2025, after which my Ruby gem's compliance test loaded zero cases and reported the skip as a pass for over a year while the README [said 100%](https://github.com/andrew/purl/issues/73). The suite requires an uppercase qualifier key to [fail in one case and pass in another](https://github.com/package-url/purl-spec/issues/942). The VERS suite has 491 npm conversion cases and one npm containment case, 977 Maven comparisons and zero Maven ranges, and [zero cases](https://github.com/git-pkgs/vers/issues/36) for Cargo, Composer, deb, rpm or Go, so the build passed with the PyPI prerelease bug present.

Each ecosystem's own tests found the bugs: the Go library now [harvests fixtures](https://github.com/git-pkgs/vers/pull/38) from node-semver, pypa/packaging, RubyGems, composer/semver, dpkg, rpm, apk-tools and others, and every batch of imported fixtures came with comparator fixes. For purl I run a new parser over a few thousand purls from production data and diff the output against the old one.

## Upstream

The second edition of ECMA-427 makes unregistered types [valid with a warning](https://github.com/package-url/purl-spec/issues/286), the 2025 rewrite put the encoding rules in one clause, and a [`git` type](https://github.com/package-url/purl-spec/issues/780) was added in 2026. The `distro` qualifier was ruled out of scope for that edition, and the proposal to replace `golang` with a `go` type that takes the whole module path as its name has been [open since 2024](https://github.com/package-url/purl-spec/pull/338) with 76 comments.

Sixteen of the twenty-four spec issues and pull requests linked in this post are open. The type definitions and test cases are JSON files in the two spec repositories, so a fix merged there shows up in the test run of every library that syncs them, and the fixtures harvested for the Go vers library are [due to go upstream](https://github.com/git-pkgs/vers/issues/54). Checking the examples for this post produced eleven new issues on my four libraries and four on my manifest parser while both suites passed.

And don't even get me started on [TEA](https://github.com/CycloneDX/transparency-exchange-api).

---

By Andrew Nesbitt (https://nesbitt.io). Markdown version of https://nesbitt.io/2026/12/03/purl-and-vers-in-practice.html
