pub struct Document {
pub schema_version: String,
pub parser: ParserInfo,
pub profile: ProfileRef,
pub source: SourceInfo,
pub config_sha256: String,
pub payload_sha256: String,
pub fingerprint: String,
pub payload: Payload,
pub diagnostics: Option<Value>,
}Expand description
Top-level document artifact (ethos.json).
Fields§
§schema_version: StringContract schema version.
parser: ParserInfoProducing parser.
profile: ProfileRefDeterministic profile identity.
source: SourceInfoSource identity.
config_sha256: Stringsha256 of c14n(effective-config subset).
payload_sha256: Stringsha256 of c14n(stable payload projection).
fingerprint: StringComposite document fingerprint (sha256:…).
payload: PayloadThe emitted payload; payload_sha256 binds its stable projection.
diagnostics: Option<Value>Runtime-only diagnostics; excluded from canonical equality and all fingerprints.
Omitted by default (--diagnostics opts in) so default outputs are byte-identical.
Implementations§
Source§impl Document
impl Document
Sourcepub fn payload_c14n(&self) -> Result<Vec<u8>, EthosError>
pub fn payload_c14n(&self) -> Result<Vec<u8>, EthosError>
c14n bytes of the emitted payload.
Sourcepub fn payload_fingerprint_c14n(&self) -> Result<Vec<u8>, EthosError>
pub fn payload_fingerprint_c14n(&self) -> Result<Vec<u8>, EthosError>
Stable c14n bytes of the payload projection used by fingerprints and G3.
Sourcepub fn compute_payload_sha256(&self) -> Result<String, EthosError>
pub fn compute_payload_sha256(&self) -> Result<String, EthosError>
Recompute payload_sha256 from the stable payload projection.
Sourcepub fn compute_payload_sha256_for_payload(
payload: &Payload,
) -> Result<String, EthosError>
pub fn compute_payload_sha256_for_payload( payload: &Payload, ) -> Result<String, EthosError>
Compute payload_sha256 for an assembled payload before the envelope exists.
Sourcepub fn payload_fingerprint_value(&self) -> Result<Value, EthosError>
pub fn payload_fingerprint_value(&self) -> Result<Value, EthosError>
Build the stable payload projection used by payload_sha256.
Sourcepub fn compute_raw_payload_sha256(&self) -> Result<String, EthosError>
pub fn compute_raw_payload_sha256(&self) -> Result<String, EthosError>
Recompute the raw payload hash for diagnostics only.
Sourcepub fn compute_fingerprint(&self) -> Result<String, EthosError>
pub fn compute_fingerprint(&self) -> Result<String, EthosError>
Recompute the composite fingerprint from embedded envelope fields.
Sourcepub fn verify_integrity(&self) -> Result<(), EthosError>
pub fn verify_integrity(&self) -> Result<(), EthosError>
Verify internal hash consistency (used by ethos fingerprint):
embedded payload_sha256 and fingerprint match recomputation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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.
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.
Source§fn parser(&self) -> ParserIdentity
fn parser(&self) -> ParserIdentity
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Source§fn fingerprint(&self) -> Option<String>
fn fingerprint(&self) -> Option<String>
sha256:… for Ethos).Source§fn pages(&self) -> Vec<PageGeometry>
fn pages(&self) -> Vec<PageGeometry>
Source§fn elements(&self) -> Vec<GroundingElement>
fn elements(&self) -> Vec<GroundingElement>
Source§fn element_by_id(&self, id: &str) -> Option<GroundingElement>
fn element_by_id(&self, id: &str) -> Option<GroundingElement>
Self::elements. Read moreSource§fn spans(&self) -> Vec<GroundingSpan>
fn spans(&self) -> Vec<GroundingSpan>
spans is true. Default: none.Source§fn tables(&self) -> Vec<GroundingTable>
fn tables(&self) -> Vec<GroundingTable>
table_cell claims downgrades accordingly).