← Về thư mục
openai4s/storage/auto_mode.py
- AutoModeConflictError · class · L30-L31 — class AutoModeConflictError(ValueError)
- AutoBudgetConflictError · class · L445-L446 — class AutoBudgetConflictError(AutoModeConflictError)
- AutoBudgetDenied · class · L449-L456 — class AutoBudgetDenied(ValueError)
- init · method · L452-L456 — def init(self, reason: str, message: str, *, field: str | None = None) -> None
- create_auto_mode_budget_schema · function · L459-L465 — def create_auto_mode_budget_schema(connection: sqlite3.Connection) -> None
- create_auto_mode_schema · function · L468-L705 — def create_auto_mode_schema(connection: sqlite3.Connection) -> None
- install_auto_mode_action_guards · function · L708-L772 — def install_auto_mode_action_guards(connection: sqlite3.Connection) -> None
- _canonical · function · L775-L788 — def _canonical(value: Any) -> str
- _digest · function · L791-L792 — def _digest(value: Any) -> str
- _load · function · L795-L799 — def _load(value: Any, default: Any) -> Any
- _text · function · L802-L808 — def _text(name: str, value: Any, *, maximum: int = 512) -> str
- _sha · function · L811-L816 — def _sha(name: str, value: Any, *, optional: bool = False) -> str | None
- _integer · function · L819-L822 — def _integer(name: str, value: Any, *, minimum: int = 0) -> int
- _string_list · function · L825-L837 — def _string_list(name: str, value: Any, *, limit: int = 10_000) -> list[str]
- _BranchStore · class · L840-L853 — class _BranchStore
- init · method · L841-L847 — def init( self, get_branch: Callable[[str], dict[str, Any] | None], get_checkpoint: Callable[[str], dict[str, Any] | None], ) -> None
- get_session_branch · method · L849-L850 — def get_session_branch(self, branch_id: str) -> dict[str, Any] | None
- get_session_checkpoint · method · L852-L853 — def get_session_checkpoint(self, checkpoint_id: str) -> dict[str, Any] | None
- AutoModeRepository · class · L856-L9634 — class AutoModeRepository
- init · method · L859-L876 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], get_branch: Callable[[str], dict[str, Any] | None] | None = None, get_checkpoint: Callable[[str], dict[str, Any] | None] | None = None, checkpoint_is_restorable: Callable[[str], bool] | None = None, get_action_group: Callable[[str], Mapping[str, Any] | None] | None = None, ) -> None
- get_selection · method · L879-L887 — def get_selection(self, scope_kind: str, scope_id: str) -> dict[str, Any] | None
- set_selection · method · L889-L959 — def set_selection( self, scope_kind: str, scope_id: str, values: Mapping[str, Any], *, expected_revision: int, ) -> dict[str, Any]
- start_run · method · L962-L1168 — def start_run( self, *, run_id: str, idempotency_key: str, root_frame_id: str, branch_id: str, turn_id: str, execution_id: str, mode: str, selection: Mapping[str, Any], budgets: Mapping[str, Any], owner_instance_id: str, created_at: int | None = None, ) -> dict[str, Any]
- record_candidate · method · L1170-L1270 — def record_candidate( self, run_id: str, *, idempotency_key: str, candidate_id: str, candidate_snapshot_sha256: str, evidence_snapshot_sha256: str, candidate_version_ids: Sequence[str], artifact_set_sha256: str | None = None, candidate_artifact_ids: Sequence[str] = (), created_at: int | None = None, ) -> dict[str, Any]
- terminate_run · method · L1272-L1392 — def terminate_run( self, run_id: str, *, idempotency_key: str, status: str, reason: str, stop_reason: str | None = None, finished_at: int | None = None, message_promotion: Mapping[str, Any] | None = None, ) -> dict[str, Any]
- _promote_terminal_message_locked · method · L1394-L1625 — def _promote_terminal_message_locked( self, run: sqlite3.Row, promotion: Mapping[str, Any], *, expected_status: str, published_at: int, replay: bool, ) -> dict[str, Any]
- promotion_receipt · function · L1534-L1553 — def promotion_receipt(metadata: Mapping[str, Any]) -> dict[str, Any]
- start_review · method · L1628-L1807 — def start_review( self, run_id: str, *, review_run_id: str, audit_id: str, idempotency_key: str, candidate_id: str, candidate_snapshot_sha256: str, evidence_snapshot: Mapping[str, Any], evidence_snapshot_sha256: str, round_index: int, attempt: int, reviewer: Mapping[str, Any], started_at: int | None = None, ) -> dict[str, Any]
- complete_review · method · L1809-L1996 — def complete_review( self, review_run_id: str, *, idempotency_key: str, status: str, verdict: str, assessment: Mapping[str, Any], findings: Sequence[Mapping[str, Any]], usage: Mapping[str, Any] | None = None, completed_at: int | None = None, ) -> dict[str, Any]
- _assert_review_assessment_proof_locked · method · L1998-L2279 — def _assert_review_assessment_proof_locked( self, row: sqlite3.Row, *, completion_visible: bool | None = None, run: sqlite3.Row | None = None, event_pair: tuple[Mapping[str, Any], Mapping[str, Any] | None] | None = None, ) -> tuple[dict[str, Any], dict[str, Any] | None]
- fail · function · L2008-L2009 — def fail() -> None
- start_repair · method · L2282-L2457 — def start_repair( self, run_id: str, *, repair_run_id: str, idempotency_key: str, finding_ids: Sequence[str], before_version_ids: Sequence[str], checkpoint_id: str, started_at: int | None = None, ) -> dict[str, Any]
- complete_repair · method · L2459-L2741 — def complete_repair( self, repair_run_id: str, *, idempotency_key: str, status: str, after_version_ids: Sequence[str], execution_group_ids: Sequence[str], verification_review_run_id: str | None = None, completed_at: int | None = None, ) -> dict[str, Any]
- bind_repair_execution_group · method · L2743-L2960 — def bind_repair_execution_group( self, repair_run_id: str, *, action_group_id: str, idempotency_key: str, bound_at: int | None = None, ) -> dict[str, Any]
- assert_repair_action_group_appendable · method · L2962-L3067 — def assert_repair_action_group_appendable( self, action_group_id: str, operation: str ) -> None
- assert_session_action_group_appendable · method · L3069-L3109 — def assert_session_action_group_appendable( self, root_frame_id: str, branch_id: str, operation: str ) -> None
- reconcile_orphaned_runs · method · L3111-L3178 — def reconcile_orphaned_runs( self, *, owner_instance_id: str, now: int ) -> list[dict[str, Any]]
- _reconcile_orphaned_run_locked · method · L3180-L3235 — def _reconcile_orphaned_run_locked( self, run_id: str, *, now: int ) -> dict[str, Any]
- _close_orphaned_phases_locked · method · L3237-L3304 — def _close_orphaned_phases_locked(self, run_id: str, *, now: int) -> None
- _release_unreconcilable_run_locked · method · L3306-L3339 — def _release_unreconcilable_run_locked( self, run_id: str, *, now: int, error: Exception ) -> dict[str, Any]
- abandon_active_run_for_revert · method · L3341-L3394 — def abandon_active_run_for_revert( self, *, root_frame_id: str, branch_id: str, target_checkpoint_id: str, revert_checkpoint_id: str, reverted_at: int, ) -> None
- _repair_ledger_snapshot_locked · method · L3396-L3614 — def _repair_ledger_snapshot_locked( self, action_group_id: str, *, completion_status: str | None, ) -> tuple[int, str]
- result_state · function · L3429-L3453 — def result_state(event: sqlite3.Row) -> str
- _repair_ledger_is_uncertain_locked · method · L3616-L3682 — def _repair_ledger_is_uncertain_locked(self, action_group_id: str) -> bool
- _repair_ledger_has_known_failure_locked · method · L3684-L3718 — def _repair_ledger_has_known_failure_locked(self, action_group_id: str) -> bool
- _repair_ledger_has_committed_effect_locked · method · L3720-L3739 — def _repair_ledger_has_committed_effect_locked(self, action_group_id: str) -> bool
- _terminalize_unknown_attempts_locked · method · L3741-L3797 — def _terminalize_unknown_attempts_locked( self, action_group_id: str, *, finished_at: int ) -> None
- _assert_repair_ledger_proof_locked · method · L3799-L4103 — def _assert_repair_ledger_proof_locked( self, row: sqlite3.Row, *, completion_visible: bool | None = None, ) -> tuple[dict[str, Any], dict[str, Any] | None]
- fail · function · L3807-L3808 — def fail() -> None
- start_permission_review · method · L4106-L4279 — def start_permission_review( self, run_id: str, *, assessment_id: str, audit_id: str, decision_id: str, action_digest: str, policy_version: str, idempotency_key: str, started_at: int | None = None, ) -> dict[str, Any]
- complete_permission_review · method · L4281-L4441 — def complete_permission_review( self, assessment_id: str, *, idempotency_key: str, status: str, outcome: str, risk: str, assessment: Mapping[str, Any], completed_at: int | None = None, ) -> dict[str, Any]
- _assert_permission_assessment_proof_locked · method · L4443-L4717 — def _assert_permission_assessment_proof_locked( self, row: sqlite3.Row, *, completion_visible: bool | None = None, run: sqlite3.Row | None = None, event_pair: tuple[Mapping[str, Any], Mapping[str, Any] | None] | None = None, ) -> tuple[dict[str, Any], dict[str, Any] | None]
- fail · function · L4461-L4462 — def fail() -> None
- event_cursor · method · L4720-L4731 — def event_cursor(self, root_frame_id: str, *, branch_id: str | None = None) -> int
- list_events · method · L4733-L4786 — def list_events( self, root_frame_id: str, *, branch_id: str | None = None, after_cursor: int | None = None, upto_cursor: int | None = None, limit: int = 100_000, ) -> list[dict[str, Any]]
- local · function · L4749-L4756 — def local(selected: str) -> list[dict[str, Any]]
- project_run · method · L4788-L4814 — def project_run( self, root_frame_id: str, branch_id: str, *, upto_event_cursor: int | None = None, ) -> dict[str, Any]: # Proof validation spans event, owner, review, and finding tables. Keep # them in one SQLite snapshot so a cross-connection completion/import # cannot manufacture a mixed read (or a false safety downgrade).
- _project_run_locked · method · L4816-L4846 — def _project_run_locked( self, root_frame_id: str, branch_id: str, *, upto_event_cursor: int | None, ) -> dict[str, Any]
- list_audits · method · L4848-L5093 — def list_audits( self, root_frame_id: str, branch_id: str, *, subject_kind: str | None = None, before: str | None = None, limit: int = 100, ) -> list[dict[str, Any]]
- scalar · function · L4912-L4913 — def scalar(value: Any) -> str | None
- integrity_failure · function · L5001-L5017 — def integrity_failure(row: dict[str, Any]) -> None
- export_projection · method · L5095-L5117 — def export_projection( self, root_frame_id: str, *, branch_id: str | None = None, upto_event_cursor: int | None = None, ) -> dict[str, Any]: # A package/share projection must be one SQLite snapshot. Otherwise a # cross-connection writer can commit audit_completed after the event # read but before the owner-row read, producing an impossible torn DTO.
- _export_projection_locked · method · L5119-L5431 — def _export_projection_locked( self, root_frame_id: str, *, branch_id: str | None, upto_event_cursor: int | None, ) -> dict[str, Any]
- _verified_read_projection · method · L5433-L5545 — def _verified_read_projection( self, run: Mapping[str, Any], events: Sequence[Mapping[str, Any]], ) -> tuple[dict[str, Any], list[dict[str, Any]]]
- _assert_no_private_import_fields · method · L5548-L5568 — def _assert_no_private_import_fields(cls, value: Any) -> None
- _normalize_import_historical_selection · method · L5571-L5607 — def _normalize_import_historical_selection(cls, value: Any) -> dict[str, Any]
- _validate_import_timestamps · method · L5610-L5626 — def _validate_import_timestamps(collections: Sequence[Sequence[Any]]) -> None
- import_quarantined_projection · method · L5628-L6185 — def import_quarantined_projection( self, source: Mapping[str, Any], *, root_frame_id: str, project_id: str | None = None, branch_id: str | None = None, branch_id_map: Mapping[str, str] | None = None, turn_id_map: Mapping[str, str] | None = None, artifact_id_map: Mapping[str, str] | None = None, version_id_map: Mapping[str, str] | None = None, cell_id_map: Mapping[str, str] | None = None, action_group_id_map: Mapping[str, str] | None = None, action_id_map: Mapping[str, str] | None = None, artifact_version_id_map: Mapping[str, str] | None = None, resume_execution: bool = False, imported_at: int | None = None, ) -> dict[str, Any]
- mapped_identity · function · L5857-L5887 — def mapped_identity(item: Mapping[str, Any]) -> tuple[str, str, str, str, str]
- _assert_imported_run_graph_locked · method · L6188-L6407 — def _assert_imported_run_graph_locked(self, run_ids: Sequence[str]) -> None
- _unique_ids · method · L6410-L6425 — def _unique_ids( records: Sequence[Mapping[str, Any]], key: str, label: str ) -> list[str]
- _mapped_import_list · method · L6428-L6439 — def _mapped_import_list( name: str, value: Any, mapping: Mapping[str, str] ) -> list[str]
- _remap_import_payload · method · L6442-L6628 — def _remap_import_payload( cls, source: Mapping[str, Any], *, run_map: Mapping[str, str], audit_map: Mapping[str, str], candidate_map: Mapping[str, str], review_map: Mapping[str, str], finding_map: Mapping[str, str], repair_map: Mapping[str, str], assessment_map: Mapping[str, str], decision_map: Mapping[str, str], artifact_map: Mapping[str, str], version_map: Mapping[str, str], cell_map: Mapping[str, str], group_map: Mapping[str, str], ) -> dict[str, Any]
- _audit_payloads_from_index · method · L6631-L6670 — def _audit_payloads_from_index( index: Mapping[tuple[str, str], Mapping[str, Any]], run_id: str, audit_id: str, subject_kind: str, ) -> tuple[dict[str, Any], dict[str, Any] | None]
- _repair_payloads_from_index · method · L6673-L6716 — def _repair_payloads_from_index( index: Mapping[tuple[str, str], Mapping[str, Any]], run_id: str, repair_run_id: str, ) -> tuple[dict[str, Any], dict[str, Any] | None, list[dict[str, Any]]]
- _import_review_rows_locked · method · L6718-L7014 — def _import_review_rows_locked( self, reviews: Sequence[Mapping[str, Any]], findings: Sequence[Mapping[str, Any]], mapped_identity: Callable[[Mapping[str, Any]], tuple[str, str, str, str, str]], review_map: Mapping[str, str], finding_map: Mapping[str, str], audit_map: Mapping[str, str], candidate_maps: Mapping[str, Mapping[str, str]], audit_event_index: Mapping[tuple[str, str], Mapping[str, Any]], artifact_map: Mapping[str, str], version_map: Mapping[str, str], cell_map: Mapping[str, str], timestamp: int, ) -> None
- _import_repair_rows_locked · method · L7016-L7223 — def _import_repair_rows_locked( self, repairs: Sequence[Mapping[str, Any]], mapped_identity: Callable[[Mapping[str, Any]], tuple[str, str, str, str, str]], repair_map: Mapping[str, str], finding_map: Mapping[str, str], review_map: Mapping[str, str], version_map: Mapping[str, str], group_map: Mapping[str, str], repair_event_index: Mapping[tuple[str, str], Mapping[str, Any]], timestamp: int, ) -> None
- _import_permission_rows_locked · method · L7225-L7421 — def _import_permission_rows_locked( self, permissions: Sequence[Mapping[str, Any]], mapped_identity: Callable[[Mapping[str, Any]], tuple[str, str, str, str, str]], assessment_map: Mapping[str, str], audit_map: Mapping[str, str], decision_map: Mapping[str, str], audit_event_index: Mapping[tuple[str, str], Mapping[str, Any]], timestamp: int, ) -> None
- _audit_public_summary · method · L7423-L7437 — def _audit_public_summary(self, audit_id: str) -> str | None
- _append_event_locked · method · L7439-L7501 — def _append_event_locked( self, run: sqlite3.Row, *, idempotency_key: str, event_type: str, request_sha256: str, payload: Mapping[str, Any], created_at: int, event_id: str | None = None, event_cursor: int | None = None, ) -> tuple[dict[str, Any], bool]
- _idempotent_event_locked · method · L7503-L7518 — def _idempotent_event_locked( self, run: sqlite3.Row, idempotency_key: str, request_sha256: str, event_type: str, ) -> dict[str, Any] | None
- _event_for_idempotency_locked · method · L7520-L7542 — def _event_for_idempotency_locked( self, run_id: str, idempotency_key: str, *, expected_type: str, expected_request_sha256: str, ) -> dict[str, Any]
- _run_locked · method · L7544-L7550 — def _run_locked(self, run_id: str) -> sqlite3.Row
- _assert_mutable_run · method · L7552-L7588 — def _assert_mutable_run(self, run: sqlite3.Row) -> None
- _assert_run_replay_integrity_locked · method · L7590-L7614 — def _assert_run_replay_integrity_locked(self, run: sqlite3.Row) -> None
- _assert_visible_run_projection_locked · method · L7616-L7782 — def _assert_visible_run_projection_locked( self, owner: sqlite3.Row, projected_run: Mapping[str, Any], events: Sequence[Mapping[str, Any]], ) -> None
- _assert_no_active_phase_locked · method · L7784-L7806 — def _assert_no_active_phase_locked(self, run: sqlite3.Row) -> None
- _assert_verified_locked · method · L7808-L7871 — def _assert_verified_locked( self, run: sqlite3.Row, *, require_terminal: bool = False, message_promotion: Mapping[str, Any] | None = None, ) -> None
- _assert_verified_promotion_locked · method · L7873-L7913 — def _assert_verified_promotion_locked( self, latest_review: sqlite3.Row, promotion: Mapping[str, Any], ) -> None
- _assert_run_event_chain_locked · method · L7915-L7929 — def _assert_run_event_chain_locked(self, run: sqlite3.Row) -> None
- _assert_run_start_event_locked · method · L7931-L7979 — def _assert_run_start_event_locked(self, run: sqlite3.Row) -> dict[str, Any]
- _assert_terminal_event_locked · method · L7981-L8049 — def _assert_terminal_event_locked( self, run: sqlite3.Row, *, expected_status: str ) -> None
- _assert_terminal_message_receipt_locked · method · L8051-L8177 — def _assert_terminal_message_receipt_locked( self, run: sqlite3.Row, receipt: Mapping[str, Any] ) -> None
- _assert_current_candidate_event_locked · method · L8179-L8233 — def _assert_current_candidate_event_locked( self, run: sqlite3.Row ) -> dict[str, Any]
- _identity · method · L8236-L8249 — def _identity( run_id: Any, root_frame_id: Any, branch_id: Any, turn_id: Any, execution_id: Any, ) -> tuple[str, str, str, str, str]
- _scope_kind · method · L8252-L8256 — def _scope_kind(value: Any) -> str
- _normalize_selection · method · L8259-L8283 — def _normalize_selection(values: Mapping[str, Any]) -> dict[str, Any]
- _time · method · L8285-L8286 — def _time(self, value: int | None) -> int
- _decode_selection · method · L8289-L8300 — def _decode_selection(row: sqlite3.Row) -> dict[str, Any]
- _decode_run · method · L8303-L8312 — def _decode_run(row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _decode_event · method · L8315-L8335 — def _decode_event(row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _transition · method · L8337-L8350 — def _transition( self, run: sqlite3.Row | Mapping[str, Any], event: Mapping[str, Any], *, created: bool, ) -> dict[str, Any]
- _review_transition · method · L8352-L8368 — def _review_transition( self, row: sqlite3.Row | Mapping[str, Any], event: Mapping[str, Any], *, created: bool, ) -> dict[str, Any]
- _repair_transition · method · L8370-L8386 — def _repair_transition( self, row: sqlite3.Row | Mapping[str, Any], event: Mapping[str, Any], *, created: bool, ) -> dict[str, Any]
- _permission_transition · method · L8388-L8404 — def _permission_transition( self, row: sqlite3.Row | Mapping[str, Any], event: Mapping[str, Any], *, created: bool, ) -> dict[str, Any]
- _decode_review · method · L8406-L8430 — def _decode_review(self, row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _decode_finding · method · L8433-L8442 — def _decode_finding(row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _decode_repair · method · L8445-L8456 — def _decode_repair(row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _decode_permission · method · L8459-L8464 — def _decode_permission(row: sqlite3.Row | Mapping[str, Any]) -> dict[str, Any]
- _normalize_finding · method · L8467-L8505 — def _normalize_finding(value: Mapping[str, Any]) -> dict[str, Any]
- _overlay_inert_import · method · L8507-L8539 — def _overlay_inert_import(self, run: dict[str, Any]) -> dict[str, Any]
- _reduce_run · method · L8542-L8626 — def _reduce_run(events: Sequence[Mapping[str, Any]]) -> dict[str, Any]
- ensure_budget_state · method · L8629-L8654 — def ensure_budget_state( self, run_id: str, *, root_run_id: str | None = None, initial_turn_tokens: int = 0, started_at: int | None = None, ) -> dict[str, Any] | None
- get_budget_state · method · L8656-L8665 — def get_budget_state(self, run_id: str) -> dict[str, Any] | None
- list_budget_reservations · method · L8667-L8682 — def list_budget_reservations(self, run_id: str) -> list[dict[str, Any]]
- reserve_budget · method · L8684-L8733 — def reserve_budget( self, *, run_id: str, admission_id: str, consumer: str, action_group_id: str, amount: int = 1, action_sha256: str | None = None, enforce_field_limit: bool = True, token_upper_bound: int | None = None, ) -> dict[str, Any]
- commit_budget · method · L8735-L8768 — def commit_budget( self, admission_id: str, *, committed_amount: int, ) -> dict[str, Any]
- release_budget · method · L8770-L8790 — def release_budget(self, admission_id: str, *, started: bool) -> dict[str, Any]
- mark_budget_unknown · method · L8792-L8793 — def mark_budget_unknown(self, admission_id: str) -> dict[str, Any]
- reconcile_budget · method · L8795-L8826 — def reconcile_budget( self, admission_id: str, *, committed_amount: int, ) -> dict[str, Any]
- record_budget_delta · method · L8828-L8870 — def record_budget_delta( self, run_id: str, *, kind: str, cursor: str, ) -> dict[str, Any]
- freeze_budget_initial_tokens · method · L8872-L8934 — def freeze_budget_initial_tokens( self, run_id: str, tokens: int, *, extra_token_multiplier: float | None = None, ) -> dict[str, Any]
- trip_budget_circuit · method · L8936-L8956 — def trip_budget_circuit( self, run_id: str, *, reason: str, field: str | None = None, ) -> dict[str, Any]
- project_budget · method · L8958-L9020 — def project_budget(self, run_id: str) -> dict[str, Any] | None
- _budget_table_ready_locked · method · L9022-L9029 — def _budget_table_ready_locked(self) -> bool
- _ensure_budget_state_locked · method · L9031-L9060 — def _ensure_budget_state_locked( self, run_id: str, *, root_run_id: str, started_at: int, initial_turn_tokens: int = 0, ) -> dict[str, Any] | None
- _budget_root_locked · method · L9062-L9078 — def _budget_root_locked(self, run_id: str) -> sqlite3.Row | None
- _run_budgets_locked · method · L9080-L9095 — def _run_budgets_locked(self, run_id: str) -> dict[str, Any]
- _circuit_reason_locked · method · L9097-L9108 — def _circuit_reason_locked(self, root_run_id: str) -> str | None
- _trip_budget_locked · method · L9110-L9145 — def _trip_budget_locked( self, run_id: str, *, reason: str, field: str | None, now: int, ) -> dict[str, Any]
- _in_flight_locked · method · L9147-L9153 — def _in_flight_locked(self, root_run_id: str, consumer: str) -> int
- _token_used_locked · method · L9155-L9164 — def _token_used_locked(self, root_run_id: str) -> tuple[int, int]
- _finding_count_locked · method · L9166-L9182 — def _finding_count_locked(self, root_run_id: str, digest: str) -> int
- _append_budget_event_locked · method · L9184-L9208 — def _append_budget_event_locked( self, *, run_id: str, root_run_id: str, admission_id: str | None, event_type: str, payload: Mapping[str, Any], created_at: int, ) -> None
- _reserve_budget_locked · method · L9210-L9470 — def _reserve_budget_locked( self, *, run_id: str, admission_id: str, consumer: str, action_group_id: str, amount: int, action_sha256: str | None, enforce_field_limit: bool, token_upper_bound: int | None, now: int, ) -> dict[str, Any]
- _settle_budget_locked · method · L9472-L9569 — def _settle_budget_locked( self, admission_id: str, *, new_state: str, committed_amount: int | None, now: int, event_type: str, allow_from: frozenset[str] | None = None, ) -> dict[str, Any]
- _release_budget_locked · method · L9571-L9611 — def _release_budget_locked(self, admission_id: str, *, now: int) -> dict[str, Any]
- _budget_int · method · L9614-L9622 — def _budget_int(budgets: Mapping[str, Any], name: str, *, default: int) -> int
- _decode_budget_state · method · L9625-L9628 — def _decode_budget_state(row: sqlite3.Row | None) -> dict[str, Any]
- _decode_budget_reservation · method · L9631-L9634 — def _decode_budget_reservation(row: sqlite3.Row | None) -> dict[str, Any]