RuntimeExtracted
yosoi.runtime_contracts.RuntimeExtracted
class RuntimeExtracted:
Inspect runtime extraction results while retaining the Rust handle.
The Python view includes empty tuples for missing candidate fields. JSON serialization preserves the original Rust wire, which may omit those entries.
Attributes: contract_schema: Schema used to interpret and complete candidate field mappings. view: Immutable status-tagged extraction DTO with every schema field represented.
Source: python/yosoi/runtime_contracts.py:754
Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.
Methods
Section titled “Methods”def __init__(self, contract_schema: ContractSchema, handle: _native.Extracted) -> None:
Parse a native extraction result and seal the Python view.
Args: contract_schema: Schema that supplies missing candidate field entries. handle: Rust extraction result retained for subsequent operations.
Raises: ValueError: Native JSON does not match the expected outcome structure.
Source: python/yosoi/runtime_contracts.py:768
status
Section titled “status”@property
def status(self) -> str:
Return the wire status; it does not alone prove business success.
Source: python/yosoi/runtime_contracts.py:803
candidates
Section titled “candidates”@property
def candidates(self) -> tuple[RuntimeCandidate, ...]:
Return unvalidated candidates, or an empty tuple for other statuses.
Source: python/yosoi/runtime_contracts.py:808
diagnostics
Section titled “diagnostics”@property
def diagnostics(self) -> tuple[ExtractionDiagnostic, ...]:
Return candidate diagnostics, or an empty tuple for other statuses.
Source: python/yosoi/runtime_contracts.py:813
document_id
Section titled “document_id”@property
def document_id(self) -> str | None:
Return the source document identity when this status carries one.
Source: python/yosoi/runtime_contracts.py:820
completeness
Section titled “completeness”@property
def completeness(self) -> IncompleteEvidence | None:
Return incomplete-evidence details for an indeterminate result, else None.
Source: python/yosoi/runtime_contracts.py:825
reason_code
Section titled “reason_code”@property
def reason_code(self) -> str | None:
Return the indeterminate reason code, or None for other statuses.
Source: python/yosoi/runtime_contracts.py:830
failure
Section titled “failure”@property
def failure(self) -> Failure | RuntimeExtractionFailure | None:
Return the typed phase failure, or None when this status has no failure.
Source: python/yosoi/runtime_contracts.py:835
validate
Section titled “validate”def validate(self, *, limits: ValidationLimits | None=None) -> RuntimeContractOutcome:
Validate extracted candidates in Rust without discarding this view.
Args: limits: Optional validation budgets; None uses Rust defaults.
Returns: Status-tagged outcome retaining accepted records and rejected candidates. Incomplete evidence and phase rejection remain explicit outcome variants.
Source: python/yosoi/runtime_contracts.py:839
to_json
Section titled “to_json”def to_json(self) -> str:
Return the original Rust wire JSON without serializing the enriched view.
Source: python/yosoi/runtime_contracts.py:856
model_dump
Section titled “model_dump”def model_dump(self) -> dict[str, Any]:
Decode the original wire into a new dictionary.
Source: python/yosoi/runtime_contracts.py:860
model_dump_json
Section titled “model_dump_json”def model_dump_json(self) -> str:
Return the original Rust wire JSON without serializing the enriched view.