Expand description
A2aVersion — the negotiated A2A revision, as a value object.
§Why Major.Minor and not a date
The A2A protocol identifies a revision by a Major.Minor string
(“0.3”, “1.0”) carried in the A2A-Version request header (or the
protocolVersion field on the agent card). It is semver-shaped, not
date-shaped, so the model is { major: u16, minor: u16 } rather than a
ReleaseDate. The string form is what crosses the wire; the parsed
form is what crosses the dispatcher’s API boundary.
§The ordering invariant
Both Ord and PartialOrd are derived, from the same field order
(major before minor), which is what the 1.98 derive fast path
requires. For that to also be correct under the A2A spec’s
“latest minor per major” rule, a future minor bumps the major
without a code change; an Unknown { major: 1, minor: 0 } must
sort the same as V1_0. See tests::unknown_versions_sort_with_their_known_equivalent.
§Why Unknown is a real struct, not a string
Holding a bare String would let Unknown be anything, including a
typo, and would make the comparison lexicographic — 0.10 < 0.2
is wrong. Holding an A2aVersion parsed from a well-formed
Major.Minor string means every Unknown is a real, ordered point
in the same Major.Minor space; the version comparators and
best_match table stay type-safe.
Enums§
- A2aVersion
- A published A2A revision, or one published after this build was compiled.
- Parse
A2aVersion Error - Why an A2A version string failed to parse.