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.
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 --> JProduct language first
Users see business actions. Draftline handles the Git-backed shape.
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]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]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 --> HTeam-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
endSimplify 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]Safety principles
The rules that keep Git powerful but out of the user's way.
- Users choose product actions, not Git commands.
- Look-around flows are read-only.
- Moving, restoring, publishing, and cleanup flows preflight first.
- Shared operations fetch and compare explicit remote identity before mutating.
- Cleanup archives old tips unless the user chooses a separate purge/redaction workflow.
- Draftline IDs and variation metadata should round-trip without parsing Git branch names.