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.5.dev0-cp314-cp314-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.14Windows x86-64

fabricatio_checkpoint-0.3.5.dev0-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.5.dev0-cp314-cp314-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

fabricatio_checkpoint-0.3.5.dev0-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.5.dev0-cp313-cp313-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

fabricatio_checkpoint-0.3.5.dev0-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.5.dev0-cp312-cp312-manylinux_2_34_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_checkpoint-0.3.5.dev0-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.5.dev0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b1c5ee62bd5706541e60b054450927f26f2ba56191d70b8c85bf7ef751eb86c5
MD5 275042813a231f11aa9dd5465bcd2ad6
BLAKE2b-256 d03f9b3731192b682dd2b0cabf4cb9bad8f26cda8e7ccf212e9c6dc82d2656a6

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 19f45126415ade52217f30212c8fa429033ea9072b7a7e7312aa1d32016e8ce3
MD5 5edad1491a270e03721ed21555a64243
BLAKE2b-256 277adb8dd6ea7f792d8ba790da49bca80f774258f700d54b03ee528348c2bb46

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 ea82325d79145615de30ee3194132fbc4cca3c84068ded0c1d21dbee3ac32dbc
MD5 44807257d9a0865a20cd813d62885c82
BLAKE2b-256 23dbccf02532dd90f584ad65b605456d140a23d8f588ddd9a64e9945ac6b4a18

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 484a0458151b336b986e6bd67ec982c992343bc0f502732de5e982f365247bee
MD5 9cc18626bda3c16cbbfa0727236f3df2
BLAKE2b-256 88d7d1b6e59bd6384ed55344f6e60390653bd03082ce92413e7a59cb85e63ae1

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3c15589151679326360828896c8ae37dc5ce5b65a73a6af799f88c91b76fd197
MD5 a10bc84861e39e28e8b79782a3dce72e
BLAKE2b-256 f8534f40884639446b16059ee6537965b0542ba3da7903287d4b07f4f460918e

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 84f05786d341bc8f32c6007e1ef463d3dc76ec9a2a3d05b573e3b66790bd4173
MD5 8fd766f304c9b37dd2b53d359f734b22
BLAKE2b-256 64b656696c93f0ba8827c3683af0f080b3a58ce8b4a1a9656ecf47b7c0bc640e

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 2a1e7adb5f9d8282174b2e79c650cbb8ac88590d41a333299a7985c89ce89569
MD5 0509c6b8e260428c773a9f60d3d7934d
BLAKE2b-256 f77356a9c92b9db2b2d8788577a027a13dc86cc062dca3dee437a137a032e786

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93e9285d2d88f6afa43632e924a250ccc6976f75c4688b0363886b3505c1ab9e
MD5 cc6e469ba513428a2f1b42cb66fc521b
BLAKE2b-256 52243989d05c72ba82fff943802b7573ecbc490fd101a1c291b741ad17a70402

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5416f21b9b5cc5cc64e770716b4fb5fa3e11b4f57cd74c3006d45eee22dcb941
MD5 c27ca40a8de927f2212a0629706c5d07
BLAKE2b-256 5bc14198abf84c4218f83b627b3d180659daca073e30cccbc1bab88dec2fd39f

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 31a87a568246289d6e57d1dcadc470f1f2410007a34ac9e166db1f2e827a3898
MD5 7dbb8688fb33a57c99483134d2ae69da
BLAKE2b-256 5061a3d1653cd6f64b52d283abfcb7532d00113e0c9fe8c94c8d6a8b00113765

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c2a41d6c155d090ba1ee39b51b695df266a238712f84f13ae3ebee46f98c400a
MD5 aa13d10276ded4ca7cf5115a9a6a73d2
BLAKE2b-256 ffe868ebd6c2c0f0b7f117f8250f666e676236db08e3675557679311a609fe2c

See more details on using hashes here.

File details

Details for the file fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_checkpoint-0.3.5.dev0-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

Hashes for fabricatio_checkpoint-0.3.5.dev0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c586645bd9933720a019b5aa4c484db2ecfeaa47f9d3e6865e09559dd1df784
MD5 72f95f588d875c2bf22f9d9c4bfddae1
BLAKE2b-256 ec20b21f3196bdcc1131d5c67e07184523a58a1a68e6930b112ad183efb7020f

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