1+ ### Atomic Transactions (Experimental)
2+
3+ [ Detailed design and usage docs] ( internal/atomic/README.md )
4+
5+ Add and delete operations are executed via a lightweight transactional journal to prevent partial state (half-written manifests or orphaned chunks).
6+
7+ Workflow:
8+
9+ 1 . Start a transaction: new/replacement files written under ` .txn/<id>/new/ ` .
10+ 2 . Deletions move originals to ` .txn/<id>/trash/ ` .
11+ 3 . Commit promotes all staged files (atomic renames) and removes trash.
12+ 4 . Rollback removes staged files and restores trash originals.
13+
14+ Manual recovery:
15+
16+ ```
17+ sietch recover --retention 24h
18+ ```
19+
20+ Scans ` .txn/ ` for incomplete transactions and resumes or rolls them back. Completed journals older than the retention window are purged.
21+
22+ Limitations / Next Steps:
23+
24+ - Current scope covers ` add ` and ` delete ` commands.
25+ - Further commands (sync, sneakernet transfer) can adopt the same API later.
26+ - Fault injection hooks for deterministic testing are planned.
27+
128# Sietch Vault
229
330[ ![ CI] ( https://github.com/substantialcattle5/sietch/actions/workflows/ci.yml/badge.svg )] ( https://github.com/substantialcattle5/sietch/actions/workflows/ci.yml )
@@ -11,9 +38,9 @@ Sietch creates self-contained encrypted vaults that can sync over LAN, sneakerne
1138
1239Sietch Vault is designed for environments where:
1340
14- * Internet is scarce, censored, or unreliable
15- * Data privacy is a necessity, not an optional feature
16- * People work nomadically—researchers, journalists, activists
41+ - Internet is scarce, censored, or unreliable
42+ - Data privacy is a necessity, not an optional feature
43+ - People work nomadically—researchers, journalists, activists
1744
1845## Quick Start
1946
@@ -28,12 +55,14 @@ make build
2855### Basic Usage
2956
3057** Create a vault**
58+
3159``` bash
3260sietch init --name dune --key-type aes # AES-256-GCM encryption
3361sietch init --name dune --key-type chacha20 # ChaCha20-Poly1305 encryption
3462```
3563
3664** Add files**
65+
3766``` bash
3867# Single file
3968sietch add ./secrets/thumper-plans.pdf documents/
@@ -46,13 +75,15 @@ sietch add ~/photos/img1.jpg ~/photos/img2.jpg vault/photos/
4675```
4776
4877** Sync over LAN**
78+
4979``` bash
5080sietch sync /ip4/192.168.1.42/tcp/4001/p2p/QmPeerID
5181# or auto-discover peers
5282sietch sync
5383```
5484
5585** Retrieve files**
86+
5687``` bash
5788sietch get thumper-plans.pdf ./retrieved/
5889```
@@ -70,30 +101,38 @@ sietch get thumper-plans.pdf ./retrieved/
70101## How It Works
71102
72103### Chunking & Deduplication
73- * Files are split into configurable chunks (default: 4MB)
74- * Identical chunks across files are deduplicated to save space
75- * Please Refer [ this] ( internal/deduplication/README.md ) documentation to understand how Deduplication works.
104+
105+ - Files are split into configurable chunks (default: 4MB)
106+ - Identical chunks across files are deduplicated to save space
107+ - Please Refer [ this] ( internal/deduplication/README.md ) documentation to understand how Deduplication works.
76108
77109### Encryption
110+
78111Each chunk is encrypted before storage using:
79- * ** Symmetric** : AES-256-GCM or ChaCha20-Poly1305 with passphrase
80- * ** Asymmetric** : GPG-compatible public/private keypairs
112+
113+ - ** Symmetric** : AES-256-GCM or ChaCha20-Poly1305 with passphrase
114+ - ** Asymmetric** : GPG-compatible public/private keypairs
81115
82116### Peer Discovery
117+
83118Peers discover each other via:
84- * LAN gossip (UDP broadcast)
85- * Manual IP whitelisting
86- * QR-code sharing * (coming soon)*
119+
120+ - LAN gossip (UDP broadcast)
121+ - Manual IP whitelisting
122+ - QR-code sharing _ (coming soon)_
87123
88124### Syncing
125+
89126Inspired by rsync, Sietch only transfers:
90- * Missing chunks
91- * Changed metadata
92- * Over encrypted TCP connections with optional compression
127+
128+ - Missing chunks
129+ - Changed metadata
130+ - Over encrypted TCP connections with optional compression
93131
94132## Available Commands
95133
96134### Core Operations
135+
97136``` bash
98137sietch init [flags] # Initialize a new vault
99138sietch add < source> < destination> [args...] # Add files to vault (multiple file support)
@@ -103,13 +142,15 @@ sietch delete <filename> # Delete files from vault
103142```
104143
105144### Network Operations
145+
106146``` bash
107147sietch discover [flags] # Discover peers on local network
108148sietch sync [peer-address] # Sync with other vaults
109149sietch sneak [flags] # Transfer via sneakernet (USB)
110150```
111151
112152### Management
153+
113154``` bash
114155sietch dedup stats # Show deduplication statistics
115156sietch dedup gc # Run garbage collection
@@ -120,27 +161,31 @@ sietch scaffold [flags] # Create vault from template
120161## Advanced Usage
121162
122163** View vault contents**
164+
123165``` bash
124166sietch ls # List all files
125167sietch ls docs/ # List files in specific directory
126168sietch ls --long # Show detailed information
127169```
128170
129171** Network synchronization**
172+
130173``` bash
131174sietch discover # Find peers automatically
132175sietch sync # Auto-discover and sync
133176sietch sync /ip4/192.168.1.5/tcp/4001/p2p/QmPeerID # Sync with specific peer
134177```
135178
136179** Sneakernet transfer**
180+
137181``` bash
138182sietch sneak # Interactive mode
139183sietch sneak --source /media/usb/vault # Transfer from USB vault
140184sietch sneak --dry-run --source /backup/vault # Preview transfer
141185```
142186
143187** Deduplication management**
188+
144189``` bash
145190sietch dedup stats # Show statistics
146191sietch dedup gc # Clean unreferenced chunks
@@ -168,26 +213,29 @@ sietch manifest
168213## Development
169214
170215### Prerequisites
171- * ** Go 1.23+** – [ Download] ( https://golang.org/dl/ )
172- * ** Git** – Version control
216+
217+ - ** Go 1.23+** – [ Download] ( https://golang.org/dl/ )
218+ - ** Git** – Version control
173219
174220### Quick Development Setup
175221
1762221 . ** Clone and setup**
177- ``` bash
178- git clone https://github.com/substantialcattle5/sietch.git
179- cd sietch
180- ./scripts/setup-hooks.sh
181- ```
223+
224+ ``` bash
225+ git clone https://github.com/substantialcattle5/sietch.git
226+ cd sietch
227+ ./scripts/setup-hooks.sh
228+ ```
182229
1832302 . ** Verify installation**
184- ` ` ` bash
185- make check-versions
186- make build
187- make test
188- ` ` `
231+ ``` bash
232+ make check-versions
233+ make build
234+ make test
235+ ```
189236
190237### Available Commands
238+
191239``` bash
192240make help # List all commands
193241make dev # Format, test, build
@@ -203,13 +251,15 @@ For detailed development guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
203251We welcome contributions of all kinds! Whether you're fixing bugs, adding features, improving documentation, or enhancing UX.
204252
205253** Quick contribution steps:**
254+
2062551 . Fork the repository
2072562 . Create a feature branch: ` git checkout -b feature/stillsuit `
2082573 . Make your changes following our [ style guidelines] ( CONTRIBUTING.md#styleguides )
2092584 . Commit using [ conventional commits] ( CONTRIBUTING.md#commit-messages )
2102595 . Push and open a Pull Request
211260
212261See our [ Contributing Guide] ( CONTRIBUTING.md ) for detailed information about:
262+
213263- Development environment setup
214264- Code style guidelines
215265- Testing requirements
@@ -218,9 +268,10 @@ See our [Contributing Guide](CONTRIBUTING.md) for detailed information about:
218268## Inspiration & Credits
219269
220270Sietch draws inspiration from:
221- * **Syncthing** - Decentralized file synchronization
222- * **IPFS** - Content-addressed storage
223- * **Obsidian Sync** - Seamless cross-device syncing
271+
272+ - ** Syncthing** - Decentralized file synchronization
273+ - ** IPFS** - Content-addressed storage
274+ - ** Obsidian Sync** - Seamless cross-device syncing
224275
225276Built with ❤️ in Go by the open source community.
226277
@@ -308,4 +359,4 @@ Licensed under the **MIT License** – see the [LICENSE](LICENSE) file for detai
308359
309360---
310361
311- > * "When you live in the desert, you develop a very strong survival instinct."* – Chani, *Dune*
362+ > _ "When you live in the desert, you develop a very strong survival instinct."_ – Chani, _ Dune _
0 commit comments