{"id":33304538,"url":"https://github.com/saworbit/diffkeeper","last_synced_at":"2026-04-15T14:05:24.903Z","repository":{"id":321849816,"uuid":"1086976546","full_name":"saworbit/diffkeeper","owner":"saworbit","description":"DiffKeeper: State-Aware Containers (SACs)","archived":false,"fork":false,"pushed_at":"2025-11-15T05:15:55.000Z","size":11332,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T05:45:57.325Z","etag":null,"topics":["containers","diff","docker","ebpf","go","kubernetes","microservices","state-management","stateful-containers"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saworbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"docs/supported-kernels.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-31T07:26:49.000Z","updated_at":"2025-11-15T05:15:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saworbit/diffkeeper","commit_stats":null,"previous_names":["saworbit/diffkeeper"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/saworbit/diffkeeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saworbit%2Fdiffkeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saworbit%2Fdiffkeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saworbit%2Fdiffkeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saworbit%2Fdiffkeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saworbit","download_url":"https://codeload.github.com/saworbit/diffkeeper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saworbit%2Fdiffkeeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285101682,"owners_count":27115042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","diff","docker","ebpf","go","kubernetes","microservices","state-management","stateful-containers"],"created_at":"2025-11-18T17:00:29.366Z","updated_at":"2026-04-15T14:05:24.890Z","avatar_url":"https://github.com/saworbit.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiffKeeper: The Kubernetes Time Machine\n\n[![CI](https://github.com/saworbit/diffkeeper/actions/workflows/ci.yml/badge.svg)](https://github.com/saworbit/diffkeeper/actions/workflows/ci.yml)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**DiffKeeper is a Black Box Flight Recorder for your containers.**\n\nIt watches your application's filesystem in real-time and records every change. When a container crashes—or a CI test flakes—you can rewind the state to any exact moment and see exactly what happened.\n\n\u003e **Note:** The earlier \"stateful containers\" design is archived. See [Genesis \u0026 Pivot](docs/GENESIS_AND_PIVOT.md) for the story.\n\n---\n\n## The Problem: \"Why did that test fail?\"\nYou have a flaky test in CI. It fails 1 out of 50 times. You re-run the job, and it passes. You have no idea why.\n* Logs only show you *what* the application printed.\n* They don't show you that a config file was corrupted, a temp file was locked, or a binary was overwritten.\n\n## The Solution: Instant Replay\nDiffKeeper uses eBPF to capture filesystem writes at line-rate and stores them in Pebble. Then it gives you a timeline so you never guess timestamps again.\n\n### 1) Record a Session\nWrap your flaky test (or any command). Minimal overhead.\n\n```bash\ndiffkeeper record --state-dir=/tmp/trace -- go test ./...\n```\n\n### 2) See the Timeline (no blindfolds)\nList every write in order to pick the exact second to rewind:\n\n```bash\ndiffkeeper timeline --state-dir=/tmp/trace\n[00m:01s] WRITE    status.log (13B)\n[00m:05s] WRITE    db.lock (6B)\n[02m:14s] WRITE    status.log (22B)   \u003c-- the failure\n```\n\n### 3) Export the Crash Site\nRestore the filesystem to the moment of failure:\n\n```bash\ndiffkeeper export --state-dir=/tmp/trace --out=./debug_fs --time=\"2m14s\"\n```\n\n`cd ./debug_fs` and inspect files exactly as they existed at that moment.\n\n## Drop-in GitHub Action\nNo curl | sh snippets needed—use the composite action directly:\n\n```yaml\nsteps:\n  - uses: actions/checkout@v4\n  - name: Record flaky test\n    uses: saworbit/diffkeeper@v1\n    with:\n      command: go test ./...\n      state-dir: diffkeeper-trace\n```\n\nOn failure the trace uploads as an artifact; you can run `diffkeeper timeline` to find the culprit write, then `diffkeeper export` to reconstruct it locally.\n\n## The \"Flaky CI\" Demo\nRun the built-in demo to see the loop end-to-end:\n\n```bash\ndiffkeeper record --state-dir=./trace -- go run ./demo/flaky-ci-test\ndiffkeeper timeline --state-dir=./trace\ndiffkeeper export --state-dir=./trace --out=./restored --time=\"2s\"\ncat ./restored/status.log  # ERROR: Connection Lost\n```\n\n## Architecture\n- **Engine:** Pure Go + eBPF (CO-RE)\n- **Storage:** Pebble (LSM) for high-speed ingestion.\n- **Diffing:** bsdiff (binary patches) for efficient storage.\n\n## CI / Dogfooding\n- GitHub Actions (`.github/workflows/ci.yml`) runs unit/race tests, cross-platform builds, and a functional time-machine test that records a flaky script and verifies exports.\n- BoltDB-era workflows remain archived under `docs/archive/v1-legacy/workflows/`.\n\n## Requirements \u0026 Compatibility\n- **Build Process:** The recommended way to build the project is with Docker, which requires no local dependencies. Simply run `make build-dockerized`. For local builds, you will need Go, `clang`, and `bpftool`.\n- **Runtime Privileges:** The core recording feature requires `sudo` privileges on Linux to attach the eBPF probes to the kernel. The application will provide a clear error if run without them.\n- **Cross-Platform Support:** The high-performance eBPF monitoring is Linux-specific. The tool provides a fallback for macOS and Windows, but its behavior and performance will differ.\n\n## Getting Started\nSee the [Quickstart](docs/quickstart.md) to record, view the timeline, and export your first trace.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaworbit%2Fdiffkeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaworbit%2Fdiffkeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaworbit%2Fdiffkeeper/lists"}