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.
Fields and class attributes
Section titled “Fields and class attributes”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.')
Methods
Section titled “Methods”from_document
Section titled “from_document”@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
capture
Section titled “capture”@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
restore
Section titled “restore”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
restore_surface
Section titled “restore_surface”def restore_surface(self, limits: Limits | None=None) -> Surface:
Restore immutable evidence and reject an interpretation identity mismatch.