cambria

Cambria Minimal VCS Data Model (Golang-Oriented)
Login

Goal: Define the simplest database-backed VCS that preserves core versioning concepts, supports filesystem checkouts, and can sync with other databases. Optimize for correctness and small surface area before advanced features.

Non-Goals (v1)

Core Concepts

Minimal Schema

Tables use integer primary keys for internal joins and textual hashes for external addressing.

Indexes:

Hashing and IDs

Manifest Format (Canonical Text)

Simple line-oriented format, stable and easy to hash:

Canonicalization:

Minimal Operations

1. Check-in

Input: working directory, parent manifest uuid (optional), comment, labels.

Golang API sketch:

2. Checkout

Input: manifest uuid, target directory.

Golang API sketch:

3. Diff (Minimal)

4. Merge (Minimal, Optional v1.1)

Note: Can defer to an external merge tool via command invocation. Store merged results as new blobs.

5. Delta Storage (Optional v1.1)

Rationale: Simplifies correctness; premature delta chains complicate sync and integrity.

6. Sync

Goal: Exchange missing artifacts and manifests with another database (peer).

Protocol (minimal):

Database process:

Golang API sketch:

7. Integrity and Validation

Filesystem Model

Transactions and Concurrency

Minimal Index Optimizations

Suggested Golang Package Layout

CLI (Minimal)

Migration Path (v1 → v2)

Summary

Start with only: blob, manifest, mlink, plink (+ simple label). Implement check-in, checkout, diff, and sync. Defer delta and complex merge to a subsequent version. Focus on integrity (uuid hashing), transactional writes, and straightforward sync frames to replicate artifacts reliably.