Notable changes per release. Entries say what changed for a caller, not what was refactored.
The rule database has its own identity, reported by uax.DatabaseVersion().
Rules change more often than the code does, and a classification is only
reproducible if you know which database produced it.
The library is unchanged and stays at v0.1.0. This release is the framework adapters only, and everyone using them should take it.
The adapters pinned the framework versions they were written against, and those
pulled in golang.org/x/crypto v0.9.0 transitively — 30 advisories between
them, 9 rated critical. Nothing in the adapters called the affected code, but a
version in a go.mod is a version that ends up in a build.
gin |
v1.9.1 | v1.12.0 |
echo |
v4.11.4 | v4.15.4 |
fiber |
v2.52.0 | v2.52.14 |
golang.org/x/crypto |
v0.9.0 | v0.54.0 |
golang.org/x/net |
v0.10.0 | v0.57.0 |
The upgrade surfaced a real gap in the Fiber adapter’s tests: fasthttp v1.73
enforces the Host header that HTTP/1.1 requires, and the fixtures did not set
one because the parser never reads it. The adapter itself needed no change.
Initial public version.
Parse reads a User-Agent and resolves browser, engine, operating system,
architecture, device type, brand and model code.ParseTo writes into caller-owned storage and allocates nothing.
TestAllocationBudget fails the build if that ever stops being true.ParseRequest additionally reads Client Hints, Sec-Fetch-* metadata and the
Accept profile.BenchmarkScaling shows the shape — 254 ns for curl/8.4.0,
1097 ns for a full Chrome-on-Android string, both allocating nothing.Sec-CH-UA-WoW64 and Sec-CH-UA-Bitness are read, and disagreements between
the string and the hints are reported as hints.arch_mismatch and
hints.bitness_mismatch. WoW64 does not excuse a bitness conflict: it
describes a 32-bit process, while bitness describes the machine.Consistency reports internal contradictions as findings with stable rule
identifiers, and Verdict separates trust from risk with an advisory action.VerdictFrom takes a coherence check the caller already ran. A verdict is
built on the findings, so ComputeVerdict has to produce them; a caller that
displays the findings too would otherwise run every spoof rule twice.
ParseRequest uses it, which is worth about 20% of its cost and one
allocation per request.Sec-CH-UA* support with GREASE brands rejected.Sec-CH-UA-Form-Factors resolves the form factor outright — including XR,
EInk, Watch and Automotive, none of which the User-Agent can express.
Values outside the specification are recorded and never interpreted.Android 10; K yields OS.Reduced with no version and no model,
because the values are placeholders that contradict reality. macOS 10_15_7
and Windows NT 10.0 are floors, so those versions are kept and flagged.
Client Hints clear the flag.This module names no hardware. SM-S928B does not contain “Galaxy S24 Ultra” —
a manufacturer assigned that mapping — so answering it needs a catalogue, and
catalogues move on a schedule a parser does not share: phones ship weekly.
Device.Model is the code the request carried, read positionally out of the
Android platform comment. No table of model codes is involved, because the
field is the code, whatever it happens to be.Everything past that — name, brand, family, form factor — comes from
Config.Device, a hook whose signature carries no types from either side, so
neither package imports the other:
import "github.com/bakhod1r/devicex"
p := uax.New(uax.Config{Device: devicex.Describe})
net/http, Gin, Echo and Fiber. It is lazy: a route that never
calls FromContext pays nothing.slog attributes, unknown-token recorder and a
runtime rule registry with atomic swap.uatest builds internally consistent fixtures, round-trip verified against
the parser.uax parse, explain, json, analyze, device, db.uax robots generates a robots.txt from the bot database. A test asserts
every emitted token parses back to the bot it claims to block, so the file
cannot drift away from the parser.cmd/uax-mcp exposes the parser over the Model Context Protocol, speaking
JSON-RPC 2.0 on stdin and stdout. Four tools: parse_user_agent,
check_consistency, lookup_device, database_info.Mozilla/5.0,
and SM-S928B contains no hint that it means Galaxy S24 Ultra. Answers carry
the confidence and the evidence behind them, and a field that did not resolve
comes back empty instead of filled in.187 rules, each shipping with the test that proves it — 55 browsers, 44 operating systems, 7 engines, 41 bots, 19 HTTP clients, 12 in-app WebViews, 9 automation frameworks.
They live in internal/table, in Go, and are reviewed as code. A lint suite
holds what a generator used to: a rule cannot exist without a test, a priority,
a confidence in (0,1], exactly one match clause, or an ID its category already
uses, and each category stays ordered by descending priority because the
resolver’s early exit depends on it.
Config.Device. devicex covers 25,475 codes as of its 2026-08-08 snapshot;
a handset newer than that resolves a brand from the code’s shape and no name.