Skip to main content

An extension of fabricatio

Project description

fabricatio-checkpoint

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Bindings: PyO3 Build Tool: uv + maturin

Worktree checkpointing via shadow Git repositories for fabricatio workflows. Save, diff, rollback individual files, or reset entire directories — without interfering with any existing Git repository.

Installation

pip install fabricatio[checkpoint]

For a full installation with all fabricatio components:

pip install fabricatio[full]

Overview

fabricatio-checkpoint maintains a bare Git shadow repository for each tracked worktree directory. It stages and commits file changes behind the scenes, enabling:

  • Checkpoints — save worktree state at any point with a message
  • Selective rollback — restore individual files to a previous commit without touching others
  • Full reset — revert the entire worktree to a prior checkpoint
  • Diffs — retrieve file-level changes between any commit and the current state
  • Status — list modified, added, or deleted files since the last checkpoint

The shadow repositories live under ~/.fabricatio-checkpoint/ by default and never touch any existing .git directory.

Key Types

CheckpointService

Manages the lifecycle of shadow repositories. Created once per process via the singleton helper.

Method Description
get_store(worktree_dir) Returns the CheckPointStore for a directory (creates on first access)
workspaces() Lists all tracked worktree directories
prune_invalid() Removes stores whose worktrees no longer exist on disk
from fabricatio_checkpoint.inited_service import get_checkpoint_service

svc = get_checkpoint_service()
store = svc.get_store("/path/to/project")

CheckPointStore

A shadow repository bound to one worktree directory. Backed by a bare Git repo (Rust implementation via PyO3).

Method Description
save(commit_msg=None) Stage all changes and commit. Returns the commit OID.
head() Returns the OID of the current HEAD commit.
commits() Returns all commit OIDs in chronological order.
reset(commit_id) Restore the entire worktree to a given commit.
rollback(commit_id, file_path) Restore a single file from a commit.
get_file_diff(commit_id, file_path) Returns the unified diff for a file at a commit.
get_status() Lists changed files since HEAD (staged + unstaged).
store = svc.get_store("/path/to/project")

cid = store.save("snapshot before refactor")
store.rollback(cid, "src/main.py")
store.reset(cid)
print(store.get_file_diff(cid, "src/main.py"))

Checkpoint (Capability Mixin)

A UseLLM-compatible mixin for use within fabricatio agent roles.

Method Description
save_checkpoint(msg) Save current state with a message
rollback(commit_id, file_path) Restore one file to a previous commit
reset_to_checkpoint(commit_id) Reset entire worktree to a commit
get_file_diff(commit_id, file_path) Diff one file against a commit
mount_checkpoint_store(store) Attach a specific store (defaults to worktree_dir)
unmount_checkpoint_store() Detach the current store
from fabricatio_checkpoint.capabilities.checkpoint import Checkpoint

class MyAgent(Checkpoint, SomeLLMRole):
    worktree_dir = Path("/path/to/project")

agent = MyAgent().mount_checkpoint_store()
cid = agent.save_checkpoint("before editing")
agent.rollback(cid, "config.toml")

prune_stores(stores_root)

Free function: deletes shadow repositories under stores_root whose worktree directories no longer exist.

from fabricatio_checkpoint.rust import prune_stores

prune_stores(Path.home() / ".fabricatio-checkpoint")

CLI

The package ships a ckpt command (requires pip install fabricatio-checkpoint[cli]):

ckpt --workspace /path/to/project save "checkpoint message"
ckpt --workspace /path/to/project reset <commit_id>
ckpt --workspace /path/to/project diff
ckpt --workspace /path/to/project ls
ckpt workspaces

Configuration

Configuration is loaded through fabricatio-core's config system under the "checkpoint" key:

  • checkpoint_dir — directory for shadow repositories (default: ~/.fabricatio-checkpoint)
  • cache_size — max cached CheckPointStore instances in memory (default: 100)
from fabricatio_checkpoint.config import checkpoint_config

checkpoint_config.checkpoint_dir = Path("/custom/checkpoint/path")
checkpoint_config.cache_size = 50

Dependencies

  • fabricatio-core — core interfaces and config system

No additional Python dependencies required for basic use. The optional [cli] extra adds typer.

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_checkpoint-0.3.4-cp314-cp314-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.14Windows x86-64

fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

fabricatio_checkpoint-0.3.4-cp314-cp314-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

fabricatio_checkpoint-0.3.4-cp313-cp313-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

fabricatio_checkpoint-0.3.4-cp313-cp313-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fabricatio_checkpoint-0.3.4-cp312-cp312-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_checkpoint-0.3.4-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file fabricatio_checkpoint-0.3.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a4fabc595bc141eb380867a6944430582f967c9151bd69a61f1d988660e860e2
MD5 22f28a398647e70a626ae104fbac7535
BLAKE2b-256 6b708cc3309184e8471bd1ecd2a4fa6c7c6d1176eaa5b46d32b5f4eef55aba1d

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2f4f8a02a95f9c528f6fb6fd06ade91fc9ad5ad7f0fb5f6584dc6b19a023515d
MD5 a9238aad58266601adf3ac2b5dbeb8da
BLAKE2b-256 252c5e97188eafaa8b08ed8fddc2380e528c6b08dbddcc09312d11398585660c

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 b3bae3bb92d8b9ac53a5bac94308e7a629e210c9a722c162c171fa4b1a94f986
MD5 c6ec9e1446bcd98caee4e72ad0834cc6
BLAKE2b-256 18fcfbe2e245734dabcd6e5fef996fd9159732c83c20069e2dd56feda9084f35

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 269aff21b688081b9c01d40428b15ec4656fc8502b225c22632b14cdaae792ad
MD5 3fb72015933582b7d475fe761683a610
BLAKE2b-256 5ca8283bd550bbb36b227c1f10cad5290c017af1ff34d040a486df29061a38cd

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b9823089c6425fa7849bbd487bdcc65be5d422839643dfb4069c18e55e5d0b62
MD5 61c4ac28a9e83e7483e5359a6eeb7eb7
BLAKE2b-256 de190e5519ab3b2247388287a5be1a3f54096c499961f70f72ee6212adb0bfc1

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a6869960f10444a2bf95b64d0eed3acd442ab3394b50c3b9f555b1fa04663c77
MD5 580009269f3a5fb422f73d666cd9674a
BLAKE2b-256 3d1cc76366c48033d6c131dafc8df083b0af02ecc3981d8951979591426b39ea

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 0121719b9344606e13902bebbf1fd029bcf142e7885e0e8db7572461c2141405
MD5 e08f1c83f96df41c6e22da515dc03b9c
BLAKE2b-256 181cc539ced3cadab93bf4f4b39331ecaee26cf1a4c1292a3548bd78e3a76e12

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc3a349148f16376b7bd6d88b73ed4adedcdc5ba6b626300cef463b8fbd1edea
MD5 ba8ede19b1ae7f130b94729e9753f8ff
BLAKE2b-256 a46bbd3eb74b922ba56d88c74a87c05f37912d2cd9d626e067efcf27c88efa45

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e9e4e44fc0ee65ddc1a295701676fcb1e5ceea9465975be5bac9f9f8f3749585
MD5 fd19d3cf188de697b30a9c6b93a84cd4
BLAKE2b-256 2d9dbab71623d13bda17b5d236d39b3c4527a9d5fc6d0979e5797b4ee9e5d69e

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4f21f2e4c2004ef2556605f3e533d10c2b899c1ca50958be86183c2dec676a39
MD5 7bd2166f643478b5c9fa7cca846d1290
BLAKE2b-256 47cf2868a82a86b0c406ed9aee7d2f1e9dd5ccbba1755ced7db2c327fedb39e7

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 5cbf9546aaf68f11c33088df5779cc9ddcf213ba6bba7715711003fc05749d64
MD5 82c0e4ce3fd7d75022e870d8e6828ff4
BLAKE2b-256 64a76aaa2beb195176a58413130452fdd784d6595ad8eca55cb9d4b7f4cf6533

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.4-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_checkpoint-0.3.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0109e17e06ee53e47330d8b37a4295382aad47f7a6926dd4d37533a2b96c8dc
MD5 cb5228dbe94e02171c03f651c7d4dcd5
BLAKE2b-256 7f4e604e04fda92d2619e682d6d499f6d7bb9662942f1f92c79d0fd701735ee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page