Skip to main content

GroundingSource

Trait GroundingSource 

Source
pub trait GroundingSource {
    // Required methods
    fn parser(&self) -> ParserIdentity;
    fn capabilities(&self) -> Capabilities;
    fn fingerprint(&self) -> Option<String>;
    fn pages(&self) -> Vec<PageGeometry>;
    fn elements(&self) -> Vec<GroundingElement>;

    // Provided methods
    fn spans(&self) -> Vec<GroundingSpan> { ... }
    fn tables(&self) -> Vec<GroundingTable> { ... }
    fn crop_ref(&self, _page: &str, _bbox: [i64; 4]) -> Option<String> { ... }
    fn element_by_id(&self, id: &str) -> Option<GroundingElement> { ... }
}
Expand description

Parser output as evidence: everything ethos-verify is allowed to know about a document. Implementations must be deterministic — same underlying artifact, same returned data, same order.

Required Methods§

Source

fn parser(&self) -> ParserIdentity

Identity of the producing parser (+ adapter when foreign).

Source

fn capabilities(&self) -> Capabilities

Capability declaration; drives explicit verification downgrades.

Source

fn fingerprint(&self) -> Option<String>

Document fingerprint when the source declares one (sha256:… for Ethos).

Source

fn pages(&self) -> Vec<PageGeometry>

Page geometry, ascending page index.

Source

fn elements(&self) -> Vec<GroundingElement>

Elements in the source’s canonical order.

Provided Methods§

Source

fn spans(&self) -> Vec<GroundingSpan>

Spans, when capability spans is true. Default: none.

Source

fn tables(&self) -> Vec<GroundingTable>

Tables, when the source models them. Default: none (verification of table_cell claims downgrades accordingly).

Source

fn crop_ref(&self, _page: &str, _bbox: [i64; 4]) -> Option<String>

Stable crop reference for an evidence region, when crop_support is true. The verify layer treats this as an opaque audit pointer; sources own how the referenced crop artifact is generated and stored.

Source

fn element_by_id(&self, id: &str) -> Option<GroundingElement>

Element lookup by id. Default: linear scan over Self::elements.

Adapters may override this as a convenience API for direct callers. The verifier builds its own deterministic per-run index from Self::elements so duplicate handling and traversal order stay tied to the evidence list.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GroundingSource for Document

Ethos output is itself just another grounding source (PRD §1.5): the verify layer sees Ethos through the same trait as any foreign parser.