A polyglot implementation of a git backup merger tool, where each component is written in the language that provides the strongest safety guarantees for that componentβs concerns.
polysafe-gitfixer helps you manage git repository backups by:
-
Scanning a directory tree for git repositories
-
Finding backup directories (
-backup,.backup-*) -
Matching backups to their corresponding repos
-
Diffing backup vs repo contents
-
Offering interactive merge/replace/delete options
-
Maintaining an append-only audit log
-
Handling failures gracefully via OTP supervision
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β COMPONENT MAP β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β Haskell β β Nickel β β
β β TUI/CLI βββββββββββ Config β β
β β (Brick) β β (schemas) β β
β ββββββββββ¬βββββββββ βββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Elixir/OTP β β
β β Orchestration & Supervision β β
β βββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬ββββ β
β β β β β β
β βΌ βΌ βΌ βΌ β
β βββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Idris β β Haskell β β Rust β β Rust β β
β βWorkflow β β Diff β β Git β β F/S β β
β β State β β Engine β β Ops β β Ops β β
β βββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββ β
β β Rust β β
β β Capability & Audit Layer β β
β ββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| Component | Language | Safety Guarantee |
|---|---|---|
Configuration |
Nickel |
Schema validation, typed defaults |
Capability & Audit |
Rust |
Path traversal prevention, tamper-evident logging |
Filesystem Ops |
Rust |
RAII, atomic transactions, rollback on failure |
Git Operations |
Rust |
Error handling, effect tracking |
Diff Engine |
Haskell |
Totality, streaming for large files |
Workflow State |
Idris 2 |
Typestate (canβt call operations in wrong order) |
Orchestration |
Elixir/OTP |
Fault isolation, supervision trees |
TUI/CLI |
Haskell (Brick) |
Elm Architecture, exhaustive event handling |
-
Rust 1.75+ (via rustup)
-
Haskell GHC 9.4+, Cabal 3.8+
-
Elixir 1.15+, OTP 26+
-
Nickel 1.4+ (optional, for config validation)
-
Idris 2 0.6+ (optional, Haskell fallback available)
polysafe-gitfixer/
βββ config/ # Nickel configuration schemas
βββ crates/ # Rust components
β βββ capability/ # Path safety & audit logging
β βββ fs_ops/ # Transactional filesystem operations
β βββ git_ops/ # Git repository operations
β βββ polysafe_nifs/ # Rustler NIFs for Elixir
βββ haskell/ # Haskell components
β βββ diff-engine/ # Tree/file diffing
β βββ tui/ # Terminal UI
βββ idris/ # Idris 2 workflow state machine
βββ elixir/ # Elixir orchestrator
βββ .well-known/ # RSR protocol files
βββ test/ # Integration testsEach component uses the language with the strongest safety guarantees for its specific concerns:
- Rust (capability, fs_ops, git_ops)
-
Memory safety without garbage collection, RAII for deterministic cleanup, strong ownership model prevents data races.
- Haskell (diff-engine, tui)
-
Strong static typing, totality checking, lazy evaluation for streaming large files, Elm Architecture for exhaustive event handling.
- Elixir/OTP (orchestrator)
-
"Let it crash" philosophy with supervision trees, process isolation, fault-tolerant by design.
- Idris 2 (workflow)
-
Dependent types enable typestate patterns where invalid states are unrepresentable at compile time.
- Nickel (configuration)
-
Schema validation with contracts, preventing configuration errors before runtime.
We welcome contributions! See CONTRIBUTING for:
-
The Tri-Perimeter Contribution Framework (TPCF)
-
Development setup instructions
-
Code style guidelines
-
How to submit merge requests
-
Security Policy - Vulnerability reporting
-
Code of Conduct - Community standards
-
Governance - Decision-making process
-
Maintainers - Project leadership
This project is dual-licensed under:
-
Palimpsest-MPL-1.0 License - Permissive, widely compatible
-
Palimpsest License v0.8 - Collaborative attribution, AI training restrictions
See LICENSE.txt for full terms.
-
Rhodium Standard - Repository standards
-
git2-rs - Rust bindings for libgit2
-
ring - Cryptographic primitives
This project follows the Rhodium Standard Repositories specification.
See TOPOLOGY.md for a visual architecture map and completion dashboard.