Draftline
Git-native versioning for creative content workflows.
Draftline is a Rust library for apps that need safe version history for folders full of creative content. It exposes business-friendly concepts like workspaces, versions, variations, change sets, preflight reports, and recovery state while keeping Git as a storage implementation detail.
Content policy
Use a ContentPolicy to describe which workspace files are user content and which files are app/runtime state. Paths are workspace-relative, extensions are normalized case-insensitively, and .draftline state is excluded by default.
use ;
Variation metadata
Variations have stable Draftline names backed by Git refs. Hosts can attach display metadata without changing those names.
use ;
label is user-facing display text. slug is host-owned metadata for URLs, routing, or integration. Neither field changes the underlying variation name or Git branch.
Opaque ID round-trips
Draftline IDs are opaque. Prefer using typed IDs in host DTOs and letting serde serialize them as strings across IPC, HTTP, or CLI boundaries. Deserializing a VersionId validates that the value is Draftline's full canonical ID form.
use ;
use ;
let command: PreviewCommand = from_str?;
assert_eq!;
# Ok::
VersionId::from_canonical_string is a lower-level helper for boundaries that cannot use typed serde DTOs. It validates Draftline's canonical ID shape, not whether the version exists in a workspace. VersionId reconstruction accepts only Draftline's full canonical version ID form, rejecting abbreviated prefixes and host-defined IDs. VariationId remains infallible to reconstruct for branch-name compatibility, but applications should still treat it as opaque; workspace operations validate whether a variation exists or is meaningful.
Remote credentials
Remote operations accept credential callbacks so host apps can fetch, clone, and publish through their own authentication flow.
use ;