pub struct TargetEvidence {Show 15 fields
pub platform: String,
pub app_id: String,
pub pid: Option<u32>,
pub window_id: Option<Value>,
pub window_title_digest: Option<String>,
pub display_id: Option<String>,
pub role: Option<String>,
pub label_digest: Option<String>,
pub bounds: Option<Bounds>,
pub observation_id: String,
pub screenshot_hash: Option<String>,
pub device_pixel_ratio: Option<f64>,
pub ui_tree_revision: Option<String>,
pub confidence: f64,
pub captured_at: String,
}Expand description
Evidence binding an action to a fresh desktop observation.
Fields§
§platform: StringPlatform identifier for the observed target (e.g. darwin, windows).
app_id: StringApplication/bundle identifier of the observed target.
pid: Option<u32>Process identifier of the observed target, when known.
window_id: Option<Value>Platform-specific window identifier, when known.
window_title_digest: Option<String>Digest of the window title (never the raw title).
display_id: Option<String>Display identifier hosting the target, when known.
role: Option<String>Accessibility role of the target element, when known.
label_digest: Option<String>Digest of the element label (never the raw label).
bounds: Option<Bounds>Bounding box of the target element, when known.
observation_id: StringIdentifier of the observation frame this evidence came from.
screenshot_hash: Option<String>Hash of the screenshot backing this observation, when captured.
device_pixel_ratio: Option<f64>Pixels per logical point of the screenshot screenshot_hash names: 2.0 for a
3024×1964 screenshot of a 1512×982-point display.
ui_tree_revision: Option<String>Revision of the UI tree backing this observation, when captured.
confidence: f64Observation confidence in 0.0..=1.0.
captured_at: StringRFC 3339 timestamp of the observation.
Implementations§
Source§impl TargetEvidence
impl TargetEvidence
Sourcepub fn check_screen_binding(&self) -> Result<(), String>
pub fn check_screen_binding(&self) -> Result<(), String>
Checks that the evidence binds its bounds to its screenshot (spec 3.7 V-I14): a target with both bounds and a screenshot hash states the screenshot’s device pixel ratio, the bounds carry the same ratio, and the box is finite and not inverted.
§Errors
Returns a message naming the violated rule.
§Example
use adk_computer_use::{Bounds, TargetEvidence};
let mut target = TargetEvidence {
platform: "darwin".into(),
app_id: "com.example.crm".into(),
pid: None,
window_id: None,
window_title_digest: None,
display_id: Some("built-in".into()),
role: None,
label_digest: None,
bounds: Some(Bounds::points(960.0, 590.0, 90.0, 40.0, 2.0)),
observation_id: "observation-1".into(),
screenshot_hash: Some("sha256:ab12".into()),
device_pixel_ratio: Some(2.0),
ui_tree_revision: None,
confidence: 0.9,
captured_at: "2026-11-22T10:00:00Z".into(),
};
assert!(target.check_screen_binding().is_ok());
target.device_pixel_ratio = None;
assert!(target.check_screen_binding().is_err());