Skip to main content

termwright_probe_ratatui/
lib.rs

1//! What a patched `ratatui-core` calls, and what it is allowed to claim.
2//!
3//! Ratatui is immediate mode. There is no retained tree, no widget that
4//! outlives the call that drew it, and no record of which widget owns which
5//! cell. The Phase 0 audit (`docs/architecture/audit/ratatui.md`) settled what
6//! follows from that, and this crate is written to respect it rather than to
7//! paper over it:
8//!
9//! - **Identity is frame-local by default.** `Widget::render` takes `self` by
10//!   value, so the widget is consumed by the call and nothing survives to be
11//!   named again. Ordinals within a frame are honest; a custom widget may opt
12//!   into an explicit author-owned semantic key, but the probe never invents
13//!   one for ordinary widgets.
14//! - **`area` is intent, not ownership.** A later write silently wins and
15//!   nothing records that it happened, so the rectangle a widget was drawn
16//!   into is not the cells it ended up with. It is reported as the intended
17//!   rectangle and never as a visible one.
18//! - **Paint order is unavailable**, so the snapshot reports pointer hit-grid
19//!   support as unavailable. Intended geometry is never promoted to pointer
20//!   ownership.
21//!
22//! The crate is deliberately small. It is a hook, a buffer of what one frame
23//! contained, and the protocol client — everything that needs `std`, kept out
24//! of the `no_std` crate that calls it.
25
26pub mod launch;
27pub mod patchset;
28pub mod session;
29pub mod tree;
30
31use std::cell::RefCell;
32use std::collections::BTreeMap;
33use std::sync::atomic::{AtomicBool, Ordering};
34use std::sync::OnceLock;
35
36use serde_json::Value;
37use termwright_protocol::client::{ENV_ENDPOINT, ENV_TOKEN};
38use termwright_protocol::{
39    ProbeIdentityKind, ProbeInfo, ProbeInjectionTier, ProbeInstrumentation, ProbeSemanticClass,
40};
41
42pub use termwright_protocol::{Action, Role};
43
44/// Author intent attached to one immediate-mode render call.
45///
46/// This type deliberately cannot carry bounds, focus, visibility, cells or
47/// collection state. Those facts belong to the framework and the terminal.
48/// Its actions are descriptive members of the protocol's closed vocabulary,
49/// not callbacks. `extended` is application-domain JSON only; keys that happen
50/// to be named `bounds`, `state` or `actions` remain nested domain data and are
51/// never promoted into protocol fields.
52#[derive(Debug, Clone, Default, PartialEq, Eq)]
53pub struct Annotation {
54    /// Semantic role chosen by the application author.
55    pub role: Option<Role>,
56    /// Accessible name chosen by the application author.
57    pub name: Option<String>,
58    /// Longer author description.
59    pub description: Option<String>,
60    /// Stable selector/correlation hint. Never promoted to node identity.
61    pub test_id: Option<String>,
62    /// Explicit application-domain JSON state.
63    pub extended: BTreeMap<String, Value>,
64    /// Descriptive protocol actions. They are capability hints, never callbacks.
65    pub actions: Vec<Action>,
66    /// Semantic keys of nodes that label this node in the same frame.
67    pub labelled_by: Vec<String>,
68    /// Semantic keys of nodes that describe this node in the same frame.
69    pub described_by: Vec<String>,
70    /// Author-owned identity for a value recreated on every frame.
71    pub semantic_key: Option<String>,
72}
73
74impl Annotation {
75    /// Start with no asserted intent.
76    #[must_use]
77    pub fn new() -> Self {
78        Self::default()
79    }
80
81    /// Set the semantic role.
82    #[must_use]
83    pub fn role(mut self, role: Role) -> Self {
84        self.role = Some(role);
85        self
86    }
87
88    /// Set the accessible name.
89    #[must_use]
90    pub fn name(mut self, name: impl Into<String>) -> Self {
91        self.name = Some(name.into());
92        self
93    }
94
95    /// Set the longer description.
96    #[must_use]
97    pub fn description(mut self, description: impl Into<String>) -> Self {
98        self.description = Some(description.into());
99        self
100    }
101
102    /// Set the stable selector/correlation hint.
103    ///
104    /// Ratatui still has frame-local identity. The value becomes `testId`, so
105    /// locators may use it and consumers may correlate deliberately, but the
106    /// node id and handshake remain frame-local.
107    #[must_use]
108    pub fn test_id(mut self, test_id: impl Into<String>) -> Self {
109        self.test_id = Some(test_id.into());
110        self
111    }
112
113    /// Add one application-domain JSON value.
114    #[must_use]
115    pub fn domain(mut self, key: impl Into<String>, value: impl Into<Value>) -> Self {
116        self.extended.insert(key.into(), value.into());
117        self
118    }
119
120    /// Replace the complete application-domain JSON object.
121    #[must_use]
122    pub fn extended(mut self, extended: BTreeMap<String, Value>) -> Self {
123        self.extended = extended;
124        self
125    }
126
127    /// Add one descriptive action from the protocol's closed vocabulary.
128    ///
129    /// The driver still performs the corresponding real terminal input; this
130    /// never registers or invokes an application callback.
131    #[must_use]
132    pub fn action(mut self, action: Action) -> Self {
133        if !self.actions.contains(&action) {
134            self.actions.push(action);
135        }
136        self
137    }
138
139    /// Relate this node to the node carrying `semantic_key` as its label.
140    #[must_use]
141    pub fn labelled_by(mut self, semantic_key: impl Into<String>) -> Self {
142        self.labelled_by.push(semantic_key.into());
143        self
144    }
145
146    /// Relate this node to the node carrying `semantic_key` as its description.
147    #[must_use]
148    pub fn described_by(mut self, semantic_key: impl Into<String>) -> Self {
149        self.described_by.push(semantic_key.into());
150        self
151    }
152
153    /// Give this annotated render call stable author-owned identity.
154    ///
155    /// A key must be unique among the frame's annotated widgets. Duplicate or
156    /// empty keys safely degrade to frame-local ids rather than invalidating
157    /// the snapshot or picking a winner by render order.
158    #[must_use]
159    pub fn semantic_key(mut self, semantic_key: impl Into<String>) -> Self {
160        self.semantic_key = Some(semantic_key.into());
161        self
162    }
163}
164
165/// What a collection widget reported about its own contents.
166///
167/// Read *after* the widget rendered, which is the only time it is true:
168/// rendering mutates the state to reflect what was actually drawn — `List`
169/// assigns `state.offset = first_visible_index` partway through — so a
170/// pre-render read would report what the application asked for rather than
171/// what the user is looking at.
172#[derive(Debug, Clone, PartialEq, Eq, Default)]
173pub struct Collection {
174    /// Highlighted row, if any. An index into the widget's own items.
175    pub selected: Option<usize>,
176    /// First visible row after the widget clamped it.
177    pub offset: usize,
178    /// How many items the widget holds.
179    pub item_count: usize,
180    /// Item text, in order, capped at [`MAX_ITEMS`].
181    pub items: Vec<String>,
182}
183
184/// How many items of a collection the probe will carry per frame.
185///
186/// A list can hold more rows than a terminal will ever show, and every one of
187/// them would be allocated, copied and validated on every frame. The cap is
188/// generous enough for a test to find what it is looking for and small enough
189/// that a hundred-thousand-row table costs nothing.
190pub const MAX_ITEMS: usize = 200;
191
192/// One `render_widget` call, as the patched crate reported it.
193///
194/// `type_name` is what `core::any::type_name` produced — a path like
195/// `ratatui_widgets::paragraph::Paragraph<'_>` for a built-in, or the
196/// application's own type for a custom widget. A hint, never a role.
197#[derive(Debug, Clone, PartialEq, Eq)]
198pub struct RenderCall {
199    /// Position in this frame's call stream. Meaningful only within the frame.
200    pub ordinal: u32,
201    /// Enclosing annotated render call when actual call nesting proves it.
202    pub parent_ordinal: Option<u32>,
203    pub type_name: &'static str,
204    pub x: u16,
205    pub y: u16,
206    pub width: u16,
207    pub height: u16,
208    /// Present when the widget is a collection that reported its contents.
209    pub collection: Option<Collection>,
210    /// Author intent supplied by `termwright-ratatui`, when the exact wrapper
211    /// was rendered through the intercepted `Frame` entry point.
212    pub annotation: Option<Annotation>,
213}
214
215/// What the probe collected for the frame currently being drawn.
216#[derive(Debug, Default)]
217pub struct FrameBuffer {
218    calls: Vec<RenderCall>,
219}
220
221impl FrameBuffer {
222    /// The calls seen so far, in the order the application made them.
223    #[must_use]
224    pub fn calls(&self) -> &[RenderCall] {
225        &self.calls
226    }
227
228    /// Forget this frame's calls, keeping the allocation for the next one.
229    pub fn clear(&mut self) {
230        self.calls.clear();
231    }
232}
233
234/// Whether this process was launched with instrumentation.
235///
236/// Read once and cached: the hook sits in the render path of every widget of
237/// every frame, and an environment lookup per call would be a cost the
238/// application never asked to pay.
239fn instrumented() -> bool {
240    static STATE: OnceLock<bool> = OnceLock::new();
241    *STATE.get_or_init(|| {
242        let named = |key: &str| std::env::var(key).map(|v| !v.is_empty()).unwrap_or(false);
243        named(ENV_ENDPOINT) && named(ENV_TOKEN)
244    })
245}
246
247/// Set once the probe has decided it cannot work, so it stops trying.
248static DISABLED: AtomicBool = AtomicBool::new(false);
249
250#[derive(Debug, Default)]
251struct FrameContext {
252    buffer: FrameBuffer,
253    annotated_stack: Vec<u32>,
254}
255
256thread_local! {
257    // A terminal draw is synchronous and its widget calls stay on the drawing
258    // thread. Keeping a stack per thread makes concurrent Terminals independent
259    // and lets a nested try_draw retain the suspended outer frame without a
260    // process-wide render mutex.
261    static FRAME_STACK: RefCell<Vec<FrameContext>> = const { RefCell::new(Vec::new()) };
262}
263
264fn with_current_frame<R>(operation: impl FnOnce(&mut FrameContext) -> R) -> Option<R> {
265    FRAME_STACK.with(|stack| {
266        let Ok(mut stack) = stack.try_borrow_mut() else {
267            DISABLED.store(true, Ordering::Release);
268            return None;
269        };
270        stack.last_mut().map(operation)
271    })
272}
273
274/// Owns one synchronous Ratatui render context on the current thread.
275pub struct FrameGuard {
276    active: bool,
277}
278
279/// Begin one certified `Terminal::try_draw` lifecycle.
280#[must_use]
281pub fn begin_frame() -> FrameGuard {
282    if !instrumented() || DISABLED.load(Ordering::Relaxed) {
283        return FrameGuard { active: false };
284    }
285    let active = FRAME_STACK.with(|stack| match stack.try_borrow_mut() {
286        Ok(mut stack) => {
287            stack.push(FrameContext::default());
288            true
289        }
290        Err(_) => {
291            DISABLED.store(true, Ordering::Release);
292            false
293        }
294    });
295    FrameGuard { active }
296}
297
298impl Drop for FrameGuard {
299    fn drop(&mut self) {
300        if !self.active {
301            return;
302        }
303        FRAME_STACK.with(|stack| match stack.try_borrow_mut() {
304            Ok(mut stack) => {
305                if stack.pop().is_none() {
306                    DISABLED.store(true, Ordering::Release);
307                }
308            }
309            Err(_) => DISABLED.store(true, Ordering::Release),
310        });
311    }
312}
313
314/// Whether the current thread is inside the certified full-frame lifecycle.
315pub fn frame_guard_active() -> bool {
316    FRAME_STACK.with(|stack| {
317        stack
318            .try_borrow()
319            .map(|stack| !stack.is_empty())
320            .unwrap_or(false)
321    })
322}
323
324/// RAII boundary for one authoritative `Annotated<W>` render call.
325pub struct AnnotatedRenderGuard {
326    ordinal: Option<u32>,
327}
328
329impl Drop for AnnotatedRenderGuard {
330    fn drop(&mut self) {
331        let Some(expected) = self.ordinal else { return };
332        if with_current_frame(|frame| frame.annotated_stack.pop()) != Some(Some(expected)) {
333            DISABLED.store(true, Ordering::Relaxed);
334        }
335    }
336}
337
338/// Called by the patched `ratatui-core` for every `Frame::render_widget`.
339///
340/// This runs inside the application's render path, so it does the least it
341/// can: one atomic read when dormant, and one push when not. It never
342/// allocates a socket, never blocks on one, and never panics — a poisoned
343/// lock disables the probe rather than unwinding into a frame the application
344/// is halfway through drawing.
345pub fn on_render(type_name: &'static str, x: u16, y: u16, width: u16, height: u16) {
346    if !instrumented() || DISABLED.load(Ordering::Relaxed) {
347        return;
348    }
349    if !frame_guard_active() {
350        return;
351    }
352    let _ = with_current_frame(|frame| {
353        let ordinal = frame.buffer.calls.len() as u32;
354        frame.buffer.calls.push(RenderCall {
355            ordinal,
356            parent_ordinal: None,
357            type_name,
358            x,
359            y,
360            width,
361            height,
362            collection: None,
363            annotation: None,
364        });
365    });
366}
367
368/// Begin an annotated render, including direct `Widget::render` calls.
369///
370/// An exact Frame hook for the same wrapper/area is claimed rather than
371/// duplicated. Otherwise the wrapper contributes the render fact itself.
372#[must_use]
373pub fn begin_annotated_render(
374    wrapper_type_name: &'static str,
375    widget_type_name: &'static str,
376    annotation: Annotation,
377    x: u16,
378    y: u16,
379    width: u16,
380    height: u16,
381) -> AnnotatedRenderGuard {
382    if !instrumented() || DISABLED.load(Ordering::Relaxed) {
383        return AnnotatedRenderGuard { ordinal: None };
384    }
385    if !frame_guard_active() {
386        return AnnotatedRenderGuard { ordinal: None };
387    }
388    let Some(ordinal) = with_current_frame(|frame| {
389        let parent_ordinal = frame.annotated_stack.last().copied();
390        let ordinal = record_annotated_call(
391            &mut frame.buffer,
392            parent_ordinal,
393            wrapper_type_name,
394            widget_type_name,
395            annotation,
396            x,
397            y,
398            width,
399            height,
400        );
401        frame.annotated_stack.push(ordinal);
402        ordinal
403    }) else {
404        return AnnotatedRenderGuard { ordinal: None };
405    };
406    AnnotatedRenderGuard {
407        ordinal: Some(ordinal),
408    }
409}
410
411#[allow(clippy::too_many_arguments)]
412fn record_annotated_call(
413    frame: &mut FrameBuffer,
414    parent_ordinal: Option<u32>,
415    wrapper_type_name: &'static str,
416    widget_type_name: &'static str,
417    annotation: Annotation,
418    x: u16,
419    y: u16,
420    width: u16,
421    height: u16,
422) -> u32 {
423    let existing = frame.calls.last_mut().filter(|call| {
424        call.type_name == wrapper_type_name
425            && call.annotation.is_none()
426            && call.x == x
427            && call.y == y
428            && call.width == width
429            && call.height == height
430    });
431    if let Some(call) = existing {
432        call.type_name = widget_type_name;
433        call.annotation = Some(annotation);
434        call.parent_ordinal = parent_ordinal;
435        call.ordinal
436    } else {
437        let ordinal = frame.calls.len() as u32;
438        frame.calls.push(RenderCall {
439            ordinal,
440            parent_ordinal,
441            type_name: widget_type_name,
442            x,
443            y,
444            width,
445            height,
446            collection: None,
447            annotation: Some(annotation),
448        });
449        ordinal
450    }
451}
452
453/// Called by a patched `ratatui-widgets` once a collection has rendered.
454///
455/// Attaches to the call the core hook recorded a moment earlier: rendering is
456/// sequential, so the widget currently drawing is the last one announced. The
457/// two hooks are in different crates because that is where the two facts live
458/// — `ratatui-core` sees every call but cannot name the state type
459/// (`StatefulWidget::State` is `?Sized`, so it cannot even be downcast), while
460/// `ratatui-widgets` knows the concrete `ListState` and can read the items
461/// themselves.
462pub fn on_collection(selected: Option<usize>, offset: usize, item_count: usize, items: &[String]) {
463    if !instrumented() || DISABLED.load(Ordering::Relaxed) {
464        return;
465    }
466    if !frame_guard_active() {
467        return;
468    }
469    let _ = with_current_frame(|frame| {
470        let Some(call) = frame.buffer.calls.last_mut() else {
471            // A collection rendered without the call being announced first.
472            // Not a shape we can attribute, so it is dropped rather than
473            // guessed at.
474            return;
475        };
476        call.collection = Some(Collection {
477            selected,
478            offset,
479            item_count,
480            items: items.iter().take(MAX_ITEMS).cloned().collect(),
481        });
482    });
483}
484
485/// Take the frame's calls and reset the buffer for the next one.
486///
487/// Returns an empty vector when the probe is dormant or disabled, so a caller
488/// needs no separate check.
489#[must_use]
490pub fn take_frame() -> Vec<RenderCall> {
491    if !instrumented() || DISABLED.load(Ordering::Relaxed) {
492        return Vec::new();
493    }
494    with_current_frame(|frame| std::mem::take(&mut frame.buffer.calls)).unwrap_or_default()
495}
496
497/// Whether the probe is collecting. For tests and diagnostics.
498#[must_use]
499pub fn active() -> bool {
500    instrumented() && !DISABLED.load(Ordering::Relaxed)
501}
502
503#[cfg(test)]
504mod tests {
505    use super::*;
506
507    /// The dormant rule reaches the innermost call: without the environment,
508    /// the hook returns before touching the buffer at all.
509    #[test]
510    fn dormant_without_the_environment() {
511        // The test process has no endpoint or token, which is the state an
512        // ordinary application is in.
513        assert!(!active());
514        on_render("Fixture", 0, 0, 1, 1);
515        assert!(take_frame().is_empty());
516    }
517
518    #[test]
519    fn a_render_call_carries_what_the_framework_reported() {
520        let call = RenderCall {
521            ordinal: 0,
522            parent_ordinal: None,
523            type_name: "ratatui_widgets::paragraph::Paragraph<'_>",
524            x: 1,
525            y: 2,
526            width: 3,
527            height: 4,
528            collection: None,
529            annotation: None,
530        };
531        // The ordinal is the only identity available, and it is frame-local.
532        assert_eq!(call.ordinal, 0);
533        assert!(call.type_name.contains("Paragraph"));
534    }
535
536    #[test]
537    fn direct_and_frame_announced_annotations_have_one_truthful_call() {
538        let mut frame = FrameBuffer {
539            calls: vec![RenderCall {
540                ordinal: 0,
541                parent_ordinal: None,
542                type_name: "my_app::Outer",
543                x: 1,
544                y: 2,
545                width: 3,
546                height: 4,
547                collection: None,
548                annotation: None,
549            }],
550        };
551
552        let direct = record_annotated_call(
553            &mut frame,
554            Some(0),
555            "termwright_ratatui::Annotated<my_app::Inner>",
556            "my_app::Inner",
557            Annotation::new().name("nested"),
558            5,
559            6,
560            7,
561            8,
562        );
563        assert_eq!(frame.calls[0].type_name, "my_app::Outer");
564        assert!(frame.calls[0].annotation.is_none());
565        assert_eq!(direct, 1);
566        assert_eq!(frame.calls[1].parent_ordinal, Some(0));
567
568        frame.calls.push(RenderCall {
569            ordinal: 2,
570            parent_ordinal: None,
571            type_name: "termwright_ratatui::Annotated<my_app::Button>",
572            x: 9,
573            y: 10,
574            width: 11,
575            height: 12,
576            collection: None,
577            annotation: None,
578        });
579        let claimed = record_annotated_call(
580            &mut frame,
581            Some(1),
582            "termwright_ratatui::Annotated<my_app::Button>",
583            "my_app::Button",
584            Annotation::new().name("claimed"),
585            9,
586            10,
587            11,
588            12,
589        );
590        assert_eq!(claimed, 2);
591        assert_eq!(frame.calls.len(), 3);
592        assert_eq!(frame.calls[2].type_name, "my_app::Button");
593        assert_eq!(frame.calls[2].parent_ordinal, Some(1));
594        assert_eq!(
595            frame.calls[2]
596                .annotation
597                .as_ref()
598                .and_then(|annotation| annotation.name.as_deref()),
599            Some("claimed")
600        );
601    }
602
603    #[test]
604    fn nested_frame_contexts_suspend_and_restore_the_outer_frame() {
605        FRAME_STACK.with(|stack| {
606            let mut stack = stack.borrow_mut();
607            assert!(stack.is_empty());
608            stack.push(FrameContext::default());
609        });
610        with_current_frame(|frame| {
611            frame.buffer.calls.push(RenderCall {
612                ordinal: 0,
613                parent_ordinal: None,
614                type_name: "Outer",
615                x: 0,
616                y: 0,
617                width: 10,
618                height: 2,
619                collection: None,
620                annotation: None,
621            });
622        });
623        FRAME_STACK.with(|stack| stack.borrow_mut().push(FrameContext::default()));
624        with_current_frame(|frame| {
625            frame.buffer.calls.push(RenderCall {
626                ordinal: 0,
627                parent_ordinal: None,
628                type_name: "Inner",
629                x: 1,
630                y: 1,
631                width: 4,
632                height: 1,
633                collection: None,
634                annotation: None,
635            });
636        });
637
638        let inner = with_current_frame(|frame| std::mem::take(&mut frame.buffer.calls))
639            .expect("inner frame");
640        assert_eq!(inner.len(), 1);
641        assert_eq!(inner[0].type_name, "Inner");
642        FRAME_STACK.with(|stack| {
643            stack.borrow_mut().pop().expect("inner context");
644        });
645        let outer = with_current_frame(|frame| std::mem::take(&mut frame.buffer.calls))
646            .expect("restored outer frame");
647        assert_eq!(outer.len(), 1);
648        assert_eq!(outer[0].type_name, "Outer");
649        FRAME_STACK.with(|stack| {
650            stack.borrow_mut().pop().expect("outer context");
651            assert!(stack.borrow().is_empty());
652        });
653    }
654}
655
656/// What this probe tells the driver it can observe.
657///
658/// The interesting part is what is absent. Ratatui offers no stable identity,
659/// no computed visible rectangle and no paint order, so none of those
660/// capabilities is claimed. Optional author annotations are supported through
661/// `termwright-ratatui`; they add intent without changing physical facts. A
662/// driver that negotiates against
663/// this gets an accurate picture of a framework that can be read but not
664/// pointed at, rather than a floor it has to guess at.
665///
666/// `operations` *is* claimed: an immediate-mode frame is a call stream, and
667/// that stream is the only structure there is.
668#[must_use]
669pub fn probe_info(framework_version: Option<&str>) -> ProbeInfo {
670    ProbeInfo {
671        framework: "ratatui".to_owned(),
672        framework_version: framework_version.map(str::to_owned),
673        probe_version: env!("CARGO_PKG_VERSION").to_owned(),
674        identity_kind: ProbeIdentityKind::FrameLocal,
675        capabilities: vec![
676            "intended-rect".to_owned(),
677            "operations".to_owned(),
678            "annotations".to_owned(),
679        ],
680        instrumentation: Some(ProbeInstrumentation {
681            highest_tier: ProbeInjectionTier::T3,
682            semantic_class: ProbeSemanticClass::A,
683            degraded_capabilities: vec![],
684        }),
685    }
686}
687
688#[cfg(test)]
689mod handshake_tests {
690    use super::*;
691
692    /// The declaration must not promise anything the framework cannot do.
693    ///
694    /// Each absent capability is a fact from the Phase 0 audit: identity dies
695    /// with the frame, no visible rectangle is computed anywhere and paint
696    /// order is not exposed. The separate SDK supplies author intent.
697    #[test]
698    fn it_claims_only_what_ratatui_gives() {
699        let declared = serde_json::to_string(&probe_info(Some("0.30.2"))).expect("serialises");
700        assert!(
701            declared.contains("\"identityKind\":\"frame-local\""),
702            "{declared}"
703        );
704        for absent in [
705            "stable-identity",
706            "visible-rect",
707            "paint-order",
708            "frame-begin",
709        ] {
710            assert!(
711                !declared.contains(absent),
712                "claimed {absent}, which Ratatui does not provide: {declared}"
713            );
714        }
715        assert!(declared.contains("\"operations\""), "{declared}");
716        assert!(declared.contains("\"annotations\""), "{declared}");
717        assert!(declared.contains("\"highestTier\":\"T3\""), "{declared}");
718        assert!(declared.contains("\"semanticClass\":\"A\""), "{declared}");
719        assert!(declared.contains("0.30.2"), "{declared}");
720    }
721
722    #[test]
723    fn the_framework_version_is_optional() {
724        let declared = serde_json::to_string(&probe_info(None)).expect("serialises");
725        assert!(!declared.contains("frameworkVersion"), "{declared}");
726    }
727}