Skip to content
YosoiDocs

ArchivedSource

yosoi.surface.ArchivedSource

class ArchivedSource(ImmutableModel):

Exact source bytes and interpretation, independent of a source file path.

Source: python/yosoi/surface.py:926

Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.

key: StrictStr = Field(description='Unique outcome-local source key.')
document: DocumentId = Field(description='Original SDK document identity.')
profile: DocumentProfile = Field(description='Exact document profile and epoch.')
sha256: StrictStr = Field(description='SHA-256 of decoded original bytes.')
content_base64: StrictStr = Field(description='Retained original bytes as base64.')
surface: StrictStr | None = Field(default=None, description='Prepared identity; absent for raw evidence envelopes.')
interpretation: SourceInterpretation = Field(default_factory=SourceInterpretation, description='Interpreter used for restoring this source.')
@classmethod
def from_document(cls, key: str, document: Document, surface: Surface | None=None) -> Self:

Freeze exact document bytes and optionally bind a prepared interpretation.

Source: python/yosoi/surface.py:944

@classmethod
def capture(cls, key: str, surface: Surface) -> Self:

Retain a prepared document, image or bundle with its exact identity.

Source: python/yosoi/surface.py:955

def restore(self, maximum: int=64 * 1024 * 1024) -> Document:

Verify and restore original bytes within a byte limit, without source I/O.

Source: python/yosoi/surface.py:961

def restore_surface(self, limits: Limits | None=None) -> Surface:

Restore immutable evidence and reject an interpretation identity mismatch.

Source: python/yosoi/surface.py:967