← Về thư mục
harness/auto_mode_contract.py
- _ContractCase · class · L84-L119 — class _ContractCase
- subject_kind · method · L114-L115 — def subject_kind(self) -> str
- subject_entity_kind · method · L118-L119 — def subject_entity_kind(self) -> str
- _Recorder · class · L122-L167 — class _Recorder
- init · method · L123-L133 — def init( self, *, identity: Mapping[str, str], clock: FakeClock, uuid_factory: FakeUUIDFactory, ) -> None
- emit · method · L135-L167 — def emit( self, kind: str, *, specific_kind: str | None = None, phase: str, status: str, payload: Mapping[str, Any] | None = None, ) -> EventEnvelope
- _mapping · function · L170-L173 — def _mapping(value: Any, where: str) -> Mapping[str, Any]
- _only_keys · function · L176-L185 — def _only_keys(value: Mapping[str, Any], allowed: set[str], where: str) -> None
- _text · function · L188-L191 — def _text(value: Any, where: str) -> str
- _identifier · function · L194-L198 — def _identifier(value: Any, where: str) -> str
- _canonical_bytes · function · L201-L214 — def _canonical_bytes(value: Any, where: str) -> bytes
- _digest · function · L217-L218 — def _digest(value: Any, where: str) -> str
- _identity · function · L221-L234 — def _identity(fixtures: Mapping[str, Any]) -> dict[str, str]
- _artifact_versions · function · L237-L271 — def _artifact_versions(candidate: Mapping[str, Any]) -> list[dict[str, str]]
- _string_list · function · L274-L283 — def _string_list(value: Any, where: str, *, nonempty: bool = True) -> list[str]
- _validate_evidence_snapshot · function · L286-L372 — def _validate_evidence_snapshot( raw: Any, *, candidate_id: str, versions: list[dict[str, str]], ) -> tuple[Mapping[str, Any], set[str]]
- _validate_review_policy · function · L375-L416 — def _validate_review_policy(raw: Any, *, outcome: str) -> Mapping[str, Any]
- _result_review_mode · function · L419-L420 — def _result_review_mode(policy: Mapping[str, Any]) -> str
- _review_request_policy · function · L423-L436 — def _review_request_policy(policy: Mapping[str, Any]) -> dict[str, Any]
- _validate_material_findings · function · L439-L481 — def _validate_material_findings( raw: Any, *, outcome: str, evidence_ref_ids: set[str], ) -> tuple[Mapping[str, Any], ...]
- _validate_fault_contract · function · L484-L527 — def _validate_fault_contract(scenario: Scenario, lane: str) -> bool
- _assessment · function · L530-L562 — def _assessment( case: _ContractCase, *, attempt: int, verdict: str | None, decision: str | None, findings: list[Mapping[str, Any]], risk: Mapping[str, Any], authorization: Mapping[str, Any], outcome: str, rationale: str, failure_kind: str | None, audit_durable: bool, retry_scheduled: bool, ) -> tuple[dict[str, Any], str]
- _completion_payload · function · L565-L597 — def _completion_payload( case: _ContractCase, assessment: Mapping[str, Any], assessment_digest: str, ) -> dict[str, Any]
- _authorization · function · L600-L613 — def _authorization( *, action_authorized: bool = False, action_executed: bool = False, infra_breaker_open: bool = False, denial_circuit_open: bool = False, ) -> dict[str, Any]
- _validate_action · function · L616-L629 — def _validate_action(raw: Any, where: str) -> Mapping[str, Any]
- _validate_guardian_allowlist · function · L632-L690 — def _validate_guardian_allowlist(action: Mapping[str, Any]) -> None
- _validate_one_shot_capability · function · L693-L728 — def _validate_one_shot_capability(raw: Any) -> Mapping[str, Any]
- _trailing_denials · function · L731-L737 — def _trailing_denials(decisions: list[str] | tuple[str, ...]) -> int
- _validate_denial_history · function · L740-L801 — def _validate_denial_history( raw: Any, ) -> tuple[tuple[str, ...], Mapping[str, Any], str]
- _load_expected · function · L804-L878 — def _load_expected(scenario_id: str) -> Mapping[str, Any]
- _validate_expected_digests · function · L881-L890 — def _validate_expected_digests( scenario: Scenario, expected: Mapping[str, Any], computed: Mapping[str, str], ) -> None
- _case · function · L893-L1219 — def _case(scenario: Scenario, expected: Mapping[str, Any]) -> _ContractCase
- _fault_payload · function · L1222-L1249 — def _fault_payload(fault: InjectedFault, case: _ContractCase) -> dict[str, Any]
- _authorization_receipt · function · L1252-L1284 — def _authorization_receipt( case: _ContractCase, *, attempt_kind: str, attempted_action_digest: str, uses_before: int, uses_after: int, capability_consumed: bool, action_authorized: bool, action_executed: bool, execution_count: int, rejection_reason: str | None, ) -> tuple[dict[str, Any], str]
- _ordered_events · function · L1287-L1306 — def _ordered_events(events: tuple[EventEnvelope, ...]) -> list[str]
- _evaluate · function · L1309-L1910 — def _evaluate( scenario: Scenario, *, case: _ContractCase, expected: Mapping[str, Any], terminal_reason: str, events: tuple[EventEnvelope, ...], faults: FaultSchedule, ) -> list[str]
- _emit_result_review · function · L1913-L2180 — def _emit_result_review( recorder: _Recorder, case: _ContractCase, faults: FaultSchedule, ) -> str
- _emit_permission_resolution · function · L2183-L2233 — def _emit_permission_resolution( recorder: _Recorder, case: _ContractCase, *, status: str, resolution_actor: str, allow: bool, attempt_kind: str, attempted_action_digest: str, uses_before: int, uses_after: int, capability_consumed: bool, action_authorized: bool, action_executed: bool, execution_count: int, rejection_reason: str | None, boundary: str | None = None, ) -> None
- _emit_one_shot_exercise · function · L2236-L2310 — def _emit_one_shot_exercise(recorder: _Recorder, case: _ContractCase) -> str
- _emit_guardian · function · L2313-L2584 — def _emit_guardian( recorder: _Recorder, case: _ContractCase, faults: FaultSchedule, ) -> str
- run_auto_mode_contract · function · L2587-L2704 — def run_auto_mode_contract( scenario: Scenario, *, offline: bool = True, clock: FakeClock | None = None, uuid_factory: FakeUUIDFactory | None = None, ) -> ScenarioResult