An extension of fabricatio
Project description
fabricatio-checkpoint
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 cachedCheckPointStoreinstances 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabricatio_checkpoint-0.3.5-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b82fd7e38331c0669988524e206e03da22e9976fe2c12712a706fc138128f41
|
|
| MD5 |
9b3a95bcbe4148d7059316826963da51
|
|
| BLAKE2b-256 |
ad146ba96e56c401a400bb3f49075de77c932a708b652b92795691bff920be22
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp314-cp314-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b753451892d22763aa41736d8a65e039dc911b7bf5c0aa1c155c71c78106d6
|
|
| MD5 |
f83c75855245b7553a029a64007b0e4b
|
|
| BLAKE2b-256 |
10cc70c76e0a2049ca12f1157baf632b6562a56435f9c200ae56393ccb27e171
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp314-cp314-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f59f95e0ba7b6e736e2a89b008ab865a42a443ea66eb7140eaf306e9537a23a5
|
|
| MD5 |
590ab172c31b8a3ca6240fd668ecafd0
|
|
| BLAKE2b-256 |
259109be5d07b83c6e8357cc9fb1f9237053538ddffc8d0896e82de644cd7535
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84dfd7f40e83afecb00b4d683a54697bbc910e68d3013753f1ca8b26e54619bd
|
|
| MD5 |
a73d200337057041159a76166b9b9315
|
|
| BLAKE2b-256 |
de1027827f051b42699ce84ba0d7b9162e72836e11c94c034da917ecbd72045e
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4a03b2a7067ba451d9912c0330163deaf77259f4b112d4a3efa61a037e62163
|
|
| MD5 |
e1dc30e6ef5d1f34831b8de54c171daf
|
|
| BLAKE2b-256 |
520a651e31176eb671dabcf9886c586cd15dffa6316b71442318c37087717ca5
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6184dd076ecf0eeb9465cd0b3063a31ae14b80405f66ba07fda64032cf031759
|
|
| MD5 |
b6ffb2ab41ce2d9a0cc79516b5fff5f1
|
|
| BLAKE2b-256 |
6a8feca2cb976194830f04661c6699f9b64661f3d89db916e06195b3cbddd228
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp313-cp313-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eda549b997a50a893da5128d5dfdb33a11b09e8ba989bbc79b62dd7d3fe38c8
|
|
| MD5 |
c91987c686b2b32f2ff84f1aa2eac413
|
|
| BLAKE2b-256 |
666ba09c899df681b34d4d460ec7c4492da22d6b04ff1002b92b9e35a6daa717
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e223f07de97114eff6b3fab5a864998e6e023266919182a1630837ef023c4b5c
|
|
| MD5 |
d51ea5ec2627f227f242e4b7ad589e51
|
|
| BLAKE2b-256 |
ec52a8d35eafaf69c7d618ab6dd18ffd453b22c687188aefe3b1518f43b65103
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
973eb60ee60d79e8786d957e3d5f15ebac815ae16c1073246cac9825f4657d28
|
|
| MD5 |
bf95ff84c9eec427f3db37fad137c197
|
|
| BLAKE2b-256 |
5be60386577262fb9588a22538232d07c83aae1f69fd82b7dd79214176edc1fa
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b3d7f0082d5c721003eaaf24580e268853870993181cbffcaaf9efeb23f7450
|
|
| MD5 |
bb5666641aa5be37073d4ffd878c9c88
|
|
| BLAKE2b-256 |
80247c8e4e36c7a6d1269891977d238320edf8c6a1f4fddd8ddda8bde63f5887
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp312-cp312-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a55072fac7699d240a52c9854f3b41e5f7745c82526574003ed4fdd9aa36a83
|
|
| MD5 |
cc2ec9797d2c4b1710439b525ab40672
|
|
| BLAKE2b-256 |
4c50d9d5c1ca9171c2a399bc9cd6dba3fb1f909fa6a534ddce1b3c7fe15f3a2d
|
File details
Details for the file fabricatio_checkpoint-0.3.5-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_checkpoint-0.3.5-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.22 {"installer":{"name":"uv","version":"0.11.22","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33014f766a7447020611ea409a78ced8ad37c1ccb005984e57c0579a796af437
|
|
| MD5 |
cc24b60f48ebcddf991c000511249fad
|
|
| BLAKE2b-256 |
ff4ab6d21fd1e58527fd6947a395604944783940d81127e4a7785ce97cfcafd7
|