MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _require_checkpoint

Method _require_checkpoint

core/filesystem.py:58–81  ·  view source on GitHub ↗

Create checkpoint before modifying core files. Only creates one checkpoint per session for efficiency. Args: path: Path being modified Raises: FilesystemAccessError: If checkpoint creation fails

(self, path: Path)

Source from the content-addressed store, hash-verified

56 self._checkpoint_created: bool = False
57
58 def _require_checkpoint(self, path: Path) -> None:
59 """
60 Create checkpoint before modifying core files.
61
62 Only creates one checkpoint per session for efficiency.
63
64 Args:
65 path: Path being modified
66
67 Raises:
68 FilesystemAccessError: If checkpoint creation fails
69 """
70 if self._checkpoint_created:
71 return # Already created checkpoint this session
72
73 try:
74 create_checkpoint(
75 reason=f"Self-modification: {path.name}",
76 files_modified=[str(path)]
77 )
78 self._checkpoint_created = True
79 info(f"Checkpoint created before modifying {path}")
80 except Exception as e:
81 raise FilesystemAccessError(f"Failed to create checkpoint: {e}")
82
83 def _validate_path(self, path: Union[str, Path]) -> Path:
84 """

Callers 4

writeMethod · 0.95
patchMethod · 0.95
appendMethod · 0.95

Calls 3

create_checkpointFunction · 0.90
infoFunction · 0.90