test(protocol): move the version ladder pins to v21

Both pins failed on the bump, which is what they exist for. The ladder
test now accepts 6..=21 and rejects 22, and the version assertion carries
the Stage 2 entry: four variants appended after their enum's final v20
variant, gated in both directions.

Also renames `protocol_version_is_twenty_for_gpu_initial_targets`, whose
name pinned the old number.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuhVYUPHXMHG8r2z4tsDPR
This commit is contained in:
Levi Neuwirth 2026-07-26 16:59:51 -04:00
parent 640c5cd0d2
commit 8af529b65d
3 changed files with 16 additions and 9 deletions

View File

@ -60,7 +60,7 @@ pub struct WireGridLimits {
///
/// Callers map these onto their own message-specific error types so
/// existing wire errors keep their exact variants and text.
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum WireGridError {
/// Rows or columns are zero or above this grid's bounds.
Size {

View File

@ -1683,7 +1683,7 @@ mod tests {
// --- M5.5a handshake & postcard round-trips ---
#[test]
fn protocol_version_is_twenty_for_gpu_initial_targets() {
fn protocol_version_is_twenty_one_for_the_bottom_panel_band() {
// Pin the value: T M10.5 bumped 1→2 (v1.0 wire: CrdtOp /
// PresenceUpdate). T M11.1 bumped 2→3 (v1.1 wire: the
// SemanticFrame family + FrontendEvent::Viewport). T M11.6
@ -1722,7 +1722,13 @@ mod tests {
// variant, see the placement pins).
// GPU initial targets bump 19→20 with a semantic-only
// SessionBootstrapRequest and appended InitialTargetResult.
assert_eq!(PROTOCOL_VERSION, 20);
// Bottom panel Stage 2 bumps 20→21 (`InstanceMessage::PanelFrame`,
// daemon-gated, plus `FrontendEvent::{FrontendCellGeometry,
// PanelResizeRows, PanelPointer}`, frontend-gated — the second
// bump that gates in BOTH directions; all four appended after
// their enum's final v20 variant, see the placement pins in
// `bottom_panel_stage2b_protocol_acceptance`).
assert_eq!(PROTOCOL_VERSION, 21);
}
#[test]
@ -1798,17 +1804,18 @@ mod tests {
// minibuffer), v13 (`LineNumbers`), v14 (`LineNumberMode`), v15
// (`CompletionPopup`), v16 (`ThemeFacts`), v17 (`FontFacts`),
// v18 (`StatuslineSegments`), v19 (the vterm terminal family),
// and v20 (semantic initial-target bootstrap) all interoperate.
for accepted in 6..=20 {
// v20 (semantic initial-target bootstrap), and v21 (the bottom
// panel band) all interoperate.
for accepted in 6..=21 {
assert!(
is_supported_protocol_version(accepted),
"v{accepted} must be accepted"
);
}
for rejected in [0, 1, 2, 3, 4, 5, 21, u32::MAX] {
for rejected in [0, 1, 2, 3, 4, 5, 22, u32::MAX] {
assert!(
!is_supported_protocol_version(rejected),
"v{rejected} must be rejected by a v20 binary"
"v{rejected} must be rejected by a v21 binary"
);
}
}

View File

@ -218,7 +218,7 @@ fn appending_panel_events_does_not_move_the_previous_final_event_discriminant()
#[test]
fn a_panel_wider_than_512_columns_is_legal_while_a_terminal_is_not() {
let wide = MAX_TERMINAL_COLS as u32 + 1;
let wide = u32::from(MAX_TERMINAL_COLS) + 1;
// The panel does not inherit the PTY per-axis cap: a 4K surface at a
// small font is legitimately this wide, and the area bound is what
@ -231,7 +231,7 @@ fn a_panel_wider_than_512_columns_is_legal_while_a_terminal_is_not() {
assert!(matches!(
terminal.validate(),
Err(TerminalFrameError::Size { cols, max_cols, .. })
if cols == wide && max_cols == MAX_TERMINAL_COLS as u32
if cols == wide && max_cols == u32::from(MAX_TERMINAL_COLS)
));
}