mirror of
https://github.com/hanzoai/replicate.git
synced 2026-10-30 18:23:20 +00:00
A version written into a manifest is written into every manifest that wants it, which is how eslint came to exist in a hundred and four forms across this estate and how a package came to resolve twice at run time. The catalog moves the number out of the manifest: a manifest names the package, the workspace names the version. Four are held below their latest because the newer release cannot be used, and the reason is recorded rather than the version alone: @noble/hashes 2 renamed every subpath the web3 stack imports, @splinetool/runtime 2 depends on a package that was never published, @dynamic-labs 5.4.1 the same, and react-resizable-panels 3 points its types condition at the bundle.
63 lines
2.1 KiB
Plaintext
63 lines
2.1 KiB
Plaintext
# Replicate
|
|
|
|
Disaster recovery tool for SQLite. Replicates WAL changes to S3, SFTP, WebDAV, NATS, or local filesystem.
|
|
|
|
## Quick Start for AI Contributors
|
|
|
|
1. Read [AI_PR_GUIDE.md](AI_PR_GUIDE.md) - PR quality requirements
|
|
2. Read [AGENTS.md](AGENTS.md) - Project overview and checklist
|
|
3. Check [CONTRIBUTING.md](CONTRIBUTING.md) - What we accept
|
|
4. Show investigation evidence in PRs
|
|
|
|
## PR Checklist
|
|
|
|
- [ ] Evidence of problem (logs, file patterns)
|
|
- [ ] Clear scope (what PR does/doesn't do)
|
|
- [ ] Runnable test commands
|
|
- [ ] Race detector tested (`go test -race`)
|
|
|
|
## Documentation
|
|
|
|
| Document | Purpose |
|
|
|----------|---------|
|
|
| [AGENTS.md](AGENTS.md) | Project overview, critical rules |
|
|
| [AI_PR_GUIDE.md](AI_PR_GUIDE.md) | PR templates, common mistakes |
|
|
| [docs/PATTERNS.md](docs/PATTERNS.md) | Code patterns and anti-patterns |
|
|
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Component details |
|
|
| [docs/SQLITE_INTERNALS.md](docs/SQLITE_INTERNALS.md) | WAL format, 1GB lock page |
|
|
| [docs/LTX_FORMAT.md](docs/LTX_FORMAT.md) | Replication format |
|
|
| [docs/TESTING_GUIDE.md](docs/TESTING_GUIDE.md) | Test strategies |
|
|
| [docs/REPLICA_CLIENT_GUIDE.md](docs/REPLICA_CLIENT_GUIDE.md) | Storage backends |
|
|
|
|
## Core Files
|
|
|
|
| File | Purpose |
|
|
|------|---------|
|
|
| `db.go` | Database monitoring, WAL, checkpoints |
|
|
| `replica.go` | Replication management |
|
|
| `store.go` | Multi-database coordination |
|
|
| `replica_client.go` | Storage backend interface |
|
|
|
|
## Storage Backends
|
|
|
|
- `s3/replica_client.go` - S3 and S3-compatible targets (hanzoai/s3, self-hosted, cloud providers)
|
|
- `sftp/replica_client.go` - SFTP
|
|
- `webdav/replica_client.go` - WebDAV
|
|
- `file/replica_client.go` - Local filesystem
|
|
- `nats/replica_client.go` - NATS JetStream
|
|
|
|
## Critical Concepts
|
|
|
|
- **Lock page at 1GB** - Always skip page at 0x40000000
|
|
- **LTX files are immutable** - Never modify after creation
|
|
- **Single replica per DB** - One destination per database
|
|
- **Layer boundaries** - DB handles state, Replica handles replication
|
|
|
|
## Build
|
|
|
|
```bash
|
|
go build -o bin/replicate ./cmd/replicate
|
|
go test -race -v ./...
|
|
pre-commit run --all-files
|
|
```
|