← Về thư mục
openai4s/server/session_branching.py
- SnapshotRepository · class · L29-L50 — class SnapshotRepository(Protocol)
- create_checkpoint · method · L30-L30 — def create_checkpoint(self, **fields: Any) -> dict[str, Any]
- fork_branch · method · L32-L32 — def fork_branch(self, **fields: Any) -> dict[str, Any]
- get_checkpoint · method · L34-L34 — def get_checkpoint(self, checkpoint_id: str) -> dict[str, Any] | None
- get_checkpoint_for_source · method · L36-L38 — def get_checkpoint_for_source( self, root_frame_id: str, *, source_kind: str, source_id: str ) -> dict[str, Any] | None
- get_branch · method · L40-L40 — def get_branch(self, branch_id: str) -> dict[str, Any] | None
- list_branches · method · L42-L42 — def list_branches(self, root_frame_id: str) -> list[dict[str, Any]]
- list_checkpoints · method · L44-L46 — def list_checkpoints( self, root_frame_id: str, *, branch_id: str | None = None, limit: int = 100 ) -> list[dict[str, Any]]
- record_operation · method · L48-L48 — def record_operation(self, **fields: Any) -> dict[str, Any]
- get_operation · method · L50-L50 — def get_operation(self, operation_id: str) -> dict[str, Any] | None
- RevertRecoveryRequiredError · class · L62-L63 — class RevertRecoveryRequiredError(RuntimeError)
- CheckpointRequest · class · L67-L75 — class CheckpointRequest
- SessionBranchingService · class · L78-L1492 — class SessionBranchingService
- init · method · L81-L108 — def init( self, repository: SnapshotRepository, cas: WorkspaceCAS, *, workspace: WorkspaceResolver, read_state: StateReader, event_sink: OperationSink | None = None, get_setting: SettingReader | None = None, set_setting: SettingWriter | None = None, delete_setting: SettingDeleter | None = None, delete_setting_if_value: SettingCompareDeleter | None = None, recovery_event_sink: OperationSink | None = None, defer_revert_unlock: bool = False, ) -> None
- create_checkpoint · method · L110-L133 — def create_checkpoint( self, root_frame_id: str, *, branch_id: str | None = None, reason: str = "manual", expected_head: str | None = None, metadata: Mapping[str, Any] | None = None, source_kind: str | None = None, source_id: str | None = None, internal: bool = False, ) -> dict[str, Any]
- fork · method · L135-L174 — def fork( self, root_frame_id: str, *, from_checkpoint_id: str, branch_id: str | None = None, name: str | None = None, source_kind: str = "checkpoint", source_id: str | None = None, ) -> dict[str, Any]
- _materialize_fork_workspace · method · L176-L202 — def _materialize_fork_workspace( self, root_frame_id: str, *, source_branch_id: str, branch_id: str, tree_id: str | None, ) -> dict[str, Any]
- preview_revert · method · L204-L258 — def preview_revert( self, root_frame_id: str, *, branch_id: str | None, target_checkpoint_id: str, ) -> dict[str, Any]
- revert_and_continue · method · L260-L644 — def revert_and_continue( self, root_frame_id: str, *, branch_id: str | None, target_checkpoint_id: str, ) -> dict[str, Any]
- undo_revert · method · L646-L662 — def undo_revert( self, root_frame_id: str, *, branch_id: str | None, revert_checkpoint_id: str, ) -> dict[str, Any]
- projection · method · L664-L679 — def projection(self, root_frame_id: str) -> dict[str, Any]
- reconcile_revert · method · L681-L735 — def reconcile_revert(self, root_frame_id: str) -> dict[str, Any]
- _reconcile_preparing_revert · method · L737-L802 — def _reconcile_preparing_revert( self, *, root_frame_id: str, operation_id: str, branch_id: str, marker: Mapping[str, Any], head: Mapping[str, Any], ) -> dict[str, Any]
- _reconcile_materialized_revert · method · L804-L969 — def _reconcile_materialized_revert( self, *, root_frame_id: str, operation_id: str, branch_id: str, marker: Mapping[str, Any], head: Mapping[str, Any], ) -> dict[str, Any]
- _ensure_reconciled_operation · method · L971-L1017 — def _ensure_reconciled_operation( self, *, operation_id: str, root_frame_id: str, branch_id: str, source_checkpoint_id: str, target_checkpoint_id: str, status: str, outcome: str, ) -> dict[str, Any]
- _existing_revert_conflict · method · L1019-L1038 — def _existing_revert_conflict( self, *, operation_id: str, root_frame_id: str, branch_id: str, source_checkpoint_id: str, target_checkpoint_id: str, ) -> dict[str, Any] | None
- _validate_revert_operation · method · L1041-L1065 — def _validate_revert_operation( existing: Mapping[str, Any], *, root_frame_id: str, branch_id: str, source_checkpoint_id: str, target_checkpoint_id: str, statuses: tuple[str, ...], ) -> dict[str, Any]
- _retain_revert_recovery · method · L1067-L1115 — def _retain_revert_recovery( self, root_frame_id: str, marker: Mapping[str, Any], error: BaseException, ) -> dict[str, Any]
- _required_marker_text · method · L1118-L1122 — def _required_marker_text(marker: Mapping[str, Any], key: str) -> str
- _capture_checkpoint · method · L1124-L1178 — def _capture_checkpoint(self, request: CheckpointRequest) -> dict[str, Any]
- _checkpoint_recipe · method · L1181-L1220 — def _checkpoint_recipe( value: Any, *, tree_id: str, artifact_versions: list[Any], ) -> dict[str, Any]
- _branch · method · L1222-L1226 — def _branch(self, root_frame_id: str, branch_id: str) -> dict[str, Any]
- _checkpoint · method · L1228-L1238 — def _checkpoint( self, root_frame_id: str, checkpoint_id: str | None ) -> dict[str, Any]
- _cursor_diff · method · L1241-L1254 — def _cursor_diff( current: Mapping[str, Any], target: Mapping[str, Any], key: str ) -> dict[str, Any]
- _set_diff · method · L1257-L1260 — def _set_diff(current: Any, target: Any) -> dict[str, list[Any]]
- _mapping_diff · method · L1263-L1271 — def _mapping_diff(current: Any, target: Any) -> dict[str, Any]
- _set_revert_recovery_state · method · L1273-L1286 — def _set_revert_recovery_state( self, root_frame_id: str, value: Mapping[str, Any] ) -> None
- _revert_recovery_raw · method · L1288-L1292 — def _revert_recovery_raw(self, root_frame_id: str) -> str | None
- _clear_revert_recovery_state · method · L1294-L1337 — def _clear_revert_recovery_state( self, root_frame_id: str, *, operation_id: str | None = None, ) -> None
- finalize_revert_unlock · method · L1339-L1343 — def finalize_revert_unlock(self, root_frame_id: str, *, operation_id: str) -> None
- release_revert_barrier_after_recovery · method · L1345-L1365 — def release_revert_barrier_after_recovery(self, root_frame_id: str) -> bool
- _record_revert_recovery · method · L1367-L1387 — def _record_revert_recovery( self, *, operation_id: str, root_frame_id: str, branch_id: str, status: str, detail: Mapping[str, Any], ) -> None
- _error_summary · method · L1390-L1392 — def _error_summary(error: BaseException) -> str
- _compensate_revert_failure · method · L1394-L1486 — def _compensate_revert_failure( self, *, error: BaseException, operation_id: str, root_frame_id: str, branch_id: str, target_checkpoint_id: str, undo: Mapping[str, Any], target: Mapping[str, Any], workspace: str | Path, preview: Mapping[str, Any], ) -> None
- _emit · method · L1488-L1492 — def _emit(self, event: dict[str, Any]) -> None