fix(panel): one negotiated version per row, a literal boundary, and a reattached doc
Three review corrections ahead of the witness rows. **THE LEGACY CONTROLS NEGOTIATED TWO DIFFERENT VERSIONS AT ONCE.** I moved their `SessionRegistry` to v24 and left their retained `SemanticRenderState` on `PROTOCOL_VERSION`, so the producer shipped `PresentMapped` to a session the daemon believed was v24. The rows passed, which is the problem: a control that negotiates two versions proves nothing about either. Five producers across the four rows now take `LEGACY_PANEL_VERSION`, the same constant the registry does. **The boundary is a LITERAL 24, not `PANEL_MAPPING_MIN_VERSION - 1`.** G6/G14 make the family boundary absolute; arithmetic against a moving constant would drag these rows forward on the next bump and they would silently begin testing v25 as "legacy". **And I split a rustdoc from its function again.** Inserting `peer_uses_mapped_panel_family` above `peer_may_send_panel_events` left the latter's doc block stranded, so my function inherited two incompatible descriptions and the documented one had none. Same mistake as `screen_size` two commits ago --- inserting an item at what looks like a blank line between declarations, when the line above is the next function's documentation. Each block sits directly above its own function now. Verified by EXIT STATUS, not by reading filtered output: `cargo test --lib` 0 (1945 passed), clippy 0, focused suite 0 (37 passed). The `composition_overhead_under_ten_percent` flake appeared once mid-run and passed isolated; it is the known wall-clock budget signature, not this diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016bqGA6s9tTUFzYpbeW3tai
This commit is contained in:
parent
0fff640d15
commit
65eef564bf
|
|
@ -1019,20 +1019,6 @@ fn panel_event_epochs_are_current(
|
|||
.is_some_and(|geometry| geometry.geometry_epoch == geometry_epoch)
|
||||
}
|
||||
|
||||
/// Whether an authenticated source may send the v21 panel event family
|
||||
/// (Q#BP9's "every gate keys on the daemon's own state").
|
||||
///
|
||||
/// All three inbound events require the same three facts, and they are
|
||||
/// checked together so no arm can satisfy two and forget the third: an
|
||||
/// installed **semantic** projection, a negotiated version that carries
|
||||
/// the variants, and a `FrontendView` this daemon itself marked
|
||||
/// panel-capable. A grid session, a pre-panel semantic peer, or a
|
||||
/// non-panel-capable view is rejected before any payload state is
|
||||
/// trusted.
|
||||
///
|
||||
/// The claimed `frontend_id` in the payload is never consulted anywhere:
|
||||
/// routing is by the authenticated transport `source`, so a forged id
|
||||
/// addresses nothing.
|
||||
/// §5b — which panel-pointer family this session speaks.
|
||||
///
|
||||
/// **Read from the AUTHENTICATED source, never from the payload's
|
||||
|
|
@ -1080,6 +1066,20 @@ fn panel_mapping_is_current(
|
|||
.is_some_and(|current| current == echoed)
|
||||
}
|
||||
|
||||
/// Whether an authenticated source may send the v21 panel event family
|
||||
/// (Q#BP9's "every gate keys on the daemon's own state").
|
||||
///
|
||||
/// All three inbound events require the same three facts, and they are
|
||||
/// checked together so no arm can satisfy two and forget the third: an
|
||||
/// installed **semantic** projection, a negotiated version that carries
|
||||
/// the variants, and a `FrontendView` this daemon itself marked
|
||||
/// panel-capable. A grid session, a pre-panel semantic peer, or a
|
||||
/// non-panel-capable view is rejected before any payload state is
|
||||
/// trusted.
|
||||
///
|
||||
/// The claimed `frontend_id` in the payload is never consulted anywhere:
|
||||
/// routing is by the authenticated transport `source`, so a forged id
|
||||
/// addresses nothing.
|
||||
fn peer_may_send_panel_events(
|
||||
editor: &EditorState,
|
||||
session_registry: &SessionRegistry,
|
||||
|
|
@ -6080,7 +6080,11 @@ mod tests {
|
|||
/// session may not send at all, so they must say which family they
|
||||
/// are exercising. Naming it here also makes them explicit legacy
|
||||
/// positive controls rather than tests that happened to pass.
|
||||
const LEGACY_PANEL_VERSION: u32 = PANEL_MAPPING_MIN_VERSION - 1;
|
||||
/// Stated as a LITERAL, not `PANEL_MAPPING_MIN_VERSION - 1`:
|
||||
/// G6/G14 make the family boundary absolute, and arithmetic against
|
||||
/// a moving constant would drag these rows forward on the next bump
|
||||
/// — they would silently start testing v25 as "legacy".
|
||||
const LEGACY_PANEL_VERSION: u32 = 24;
|
||||
|
||||
fn dispatch_panel_event(
|
||||
editor: &mut crate::editor::EditorState,
|
||||
|
|
@ -6354,7 +6358,7 @@ mod tests {
|
|||
let mut semantic_states = HashMap::new();
|
||||
semantic_states.insert(
|
||||
fid,
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, PROTOCOL_VERSION),
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, LEGACY_PANEL_VERSION),
|
||||
);
|
||||
editor.accept_semantic_frame_geometry(fid, 1, CellSize::new(24, 80));
|
||||
let (geometry_epoch, panel_epoch) = shipped_declaration(&editor, fid, &mut semantic_states);
|
||||
|
|
@ -6428,7 +6432,7 @@ mod tests {
|
|||
let mut semantic_states = HashMap::new();
|
||||
semantic_states.insert(
|
||||
fid,
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, PROTOCOL_VERSION),
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, LEGACY_PANEL_VERSION),
|
||||
);
|
||||
editor.accept_semantic_frame_geometry(fid, 1, CellSize::new(24, 80));
|
||||
let (geometry_epoch, panel_epoch) = shipped_declaration(&editor, fid, &mut semantic_states);
|
||||
|
|
@ -6652,7 +6656,7 @@ mod tests {
|
|||
let mut semantic_states = HashMap::new();
|
||||
semantic_states.insert(
|
||||
fid,
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, PROTOCOL_VERSION),
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, LEGACY_PANEL_VERSION),
|
||||
);
|
||||
editor.accept_semantic_frame_geometry(fid, 1, CellSize::new(24, 80));
|
||||
let (geometry_epoch, panel_epoch) = shipped_declaration(&editor, fid, &mut semantic_states);
|
||||
|
|
@ -6793,7 +6797,7 @@ mod tests {
|
|||
let mut semantic_states = HashMap::new();
|
||||
semantic_states.insert(
|
||||
fid,
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, PROTOCOL_VERSION),
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, LEGACY_PANEL_VERSION),
|
||||
);
|
||||
editor.accept_semantic_frame_geometry(fid, 1, CellSize::new(24, 80));
|
||||
let (geometry_epoch, panel_epoch) = shipped_declaration(&editor, fid, &mut semantic_states);
|
||||
|
|
@ -6880,7 +6884,7 @@ mod tests {
|
|||
let mut semantic_states = HashMap::new();
|
||||
semantic_states.insert(
|
||||
fid,
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, PROTOCOL_VERSION),
|
||||
crate::semantic_render::SemanticRenderState::for_peer(fid, LEGACY_PANEL_VERSION),
|
||||
);
|
||||
editor.accept_semantic_frame_geometry(fid, 1, CellSize::new(24, 80));
|
||||
let (geometry_epoch, panel_epoch) = shipped_declaration(&editor, fid, &mut semantic_states);
|
||||
|
|
|
|||
Loading…
Reference in New Issue