Draftline for app-owned workspaces

Version history for creative apps, without Git footguns.

Draftline gives Tauri and desktop apps safe, Git-backed saves, variations, collaboration, cleanup, and recovery for folders of creative or business content. Users get product actions like save, try another direction, publish, and restore.

The Draftline safety loop
flowchart LR
    A[Business intent] --> B{Read only?}
    B -- Yes --> C[preview, diff, summary, status]
    B -- No --> D{Can lose, hide, or share work?}
    D -- Yes --> E[preflight and explicit choice]
    D -- No --> F[append-only or ref-creating action]
    E --> G[operation lock and recovery state]
    F --> G
    G --> H{Visible ref deleted or rewritten?}
    H -- Yes --> I[archive old tip under refs/draftline]
    H -- No --> J[business-shaped result]
    I --> J
39documented product flows
21covered or scoped-covered flows
16partially covered flows
2planned or not-yet-covered flows

Product language first

Users see business actions. Draftline handles the Git-backed shape.

SaveCommit tracked content
Try another directionCreate a variation
Go backRestore as a new save
ShareFetch, compare, publish
Clean upArchive first, then rewrite
RecoverUse hidden support refs

Scenario map

All core Draftline scenarios, organized by user intent.

These scenario groups mirror the repository's product scenario contract and use Mermaid diagrams to show how each intent moves through Draftline's safe primitives.

Start safely

Workspace setup

Open, initialize, clone, or adopt a workspace without assuming a repository is already shaped for Draftline.

  • init / open / clone_workspace
  • workspace_summary
  • preflight_adopt_workspace
  • inspect
flowchart TD
    A[User opens work] --> B{Source}
    B -- New folder --> C[init with policy]
    B -- Existing repo --> D[read-only adoption scan]
    B -- Shared remote --> E[clone workspace]
    C --> F[workspace summary]
    D --> F
    E --> F
    F --> G{Recovery or lock?}
    G -- Yes --> H[show recovery prompt]
    G -- No --> I[normal dashboard]
Open in docs

Save the right files

Content policy

Define which workspace files are business content, and surface hazards when policy, Git ignore rules, or previous saves disagree.

  • ContentPolicy
  • audit_content_policy
  • policy_git_diagnostics
  • changes
flowchart TD
    A[Host defines business content] --> B{Policy rule}
    B -- folders --> C[include paths]
    B -- extensions --> D[include extensions]
    B -- runtime/private --> E[exclude paths]
    C --> F[open workspace with policy]
    D --> F
    E --> F
    F --> G{Git hides or transforms content?}
    G -- Yes --> H[diagnostics and host choice]
    G -- No --> I[safe save surface]
Open in docs

Creative iteration

Authoring and versions

Turn edits into named versions, preview old work, branch into variations, switch safely, and restore without erasing history.

  • save_version
  • create_variation
  • preflight_switch_variation
  • restore_version_as_new_save
flowchart TD
    A[User edits content] --> B[changes]
    B --> C{Intent}
    C -- keep it --> D[save version]
    C -- try another direction --> E[create variation]
    C -- move directions --> F[preflight switch]
    C -- bring back old work --> G[restore as new save]
    D --> H[history stays understandable]
    E --> H
    F --> H
    G --> H
Open in docs

Team-safe sharing

Collaboration

Publish, receive, adopt, and reconcile remote work by fetching first and refusing hidden overwrites.

  • preflight_publish / publish
  • fetch_remote
  • apply_incoming
  • merge_incoming
sequenceDiagram
    participant User
    participant App
    participant Draftline
    participant Remote
    User->>App: Publish or get updates
    App->>Draftline: fetch and preflight
    Draftline->>Remote: read latest remote state
    alt safe fast-forward or publish
      Draftline->>Remote: push or apply expected ref
      Draftline-->>App: business-shaped result
    else incoming, diverged, or raced
      Draftline-->>App: explicit blocker
      App-->>User: review, merge, or retry
    end
Open in docs

Simplify without losing recoverability

Recovery and cleanup

Shelve unfinished work, compact noisy history, clean up old variations, sync hidden support refs, and separate retention from purge.

  • shelve_changes
  • apply_history_cleanup
  • publish_support_refs
  • preflight_purge_content
flowchart TD
    A[User asks to clean up] --> B{Cleanup kind}
    B -- shelve --> C[local shelf ref]
    B -- compact --> D[preview cleanup]
    B -- delete variation --> E[archive old tip]
    D --> F[move visible refs after backup]
    E --> F
    C --> G[recoverable state]
    F --> G
    G --> H{Shared work?}
    H -- Yes --> I[publish hidden support refs]
    H -- No --> J[local recovery point]
Open in docs

Safety principles

The rules that keep Git powerful but out of the user's way.

  1. Users choose product actions, not Git commands.
  2. Look-around flows are read-only.
  3. Moving, restoring, publishing, and cleanup flows preflight first.
  4. Shared operations fetch and compare explicit remote identity before mutating.
  5. Cleanup archives old tips unless the user chooses a separate purge/redaction workflow.
  6. Draftline IDs and variation metadata should round-trip without parsing Git branch names.