Runtime selection is used by checksum and package-processing paths, but broad selectors currently cannot express exceptions, and slash-form selectors accept unsupported platform names. Extend the existing runtime.GetRuntimes and runtime.GetRuntimesFromEnvs APIs into a validated, ordered selector contract without changing their signatures.
A selector body is exactly one of all, an OS (darwin, linux, or windows), an architecture (amd64 or arm64), or a valid OS/architecture pair from those values. Trim surrounding whitespace before parsing; empty bodies, internal whitespace, extra slash components, or unknown OS/architecture values are invalid. GetRuntimes accepts positive selector bodies only. It must retain the established expansions: an OS expands to amd64 then arm64; an architecture expands across darwin, windows, then linux; all expands in canonical order (darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64, windows/arm64); and an exact pair yields only that pair.
GetRuntimesFromEnvs additionally accepts an exclusion written as one leading ! immediately followed by a selector body. Positive selectors form an ordered union: process them in input order, use each selector's expansion order, and keep only the first occurrence of each runtime. Exclusions subtract every matching runtime regardless of whether they appear before or after a positive selector, so a later positive selector must not re-add an excluded runtime and all must not bypass exclusions. When a non-nil list has at least one positive selector, its starting set is empty. When it contains exclusions but no positive selector, start from the canonical all set and subtract. Preserve the existing distinction that a nil list means canonical all, while an explicitly empty non-nil list means no runtimes.
Validation is atomic. If either API receives an invalid selector, return a nil runtime slice and a non-nil error rather than any partial selection. For every non-empty invalid token, the error text must include that token after surrounding whitespace has been trimmed so callers can identify the bad entry. Trim outer whitespace before recognizing !; a bare or repeated ! is invalid. Results are caller-owned: every call must return fresh slice storage and fresh Runtime values, so mutating one result cannot change a later result from either API.