Skip to content

Reversible drive export as a git working tree - #1279

Draft
joepio wants to merge 6 commits into
developfrom
cursor/drive-as-git-repo-b29e
Draft

Reversible drive export as a git working tree#1279
joepio wants to merge 6 commits into
developfrom
cursor/drive-as-git-repo-b29e

Conversation

@joepio

@joepio joepio commented Aug 16, 2026

Copy link
Copy Markdown
Member

Related Issues

Exploration + prototype for exporting an Atomic drive as a git repo (readable backup / interchange). Not a sync transport and not a vault restore.

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed

What this does

v2 of atomic-git-export is content-reversible:

  • Identity is localId (existing property, else the export path). Sidecars have no @id; in-drive links are rewritten to localIds. Blob hashes stay did:ad:blob:{blake3}.
  • Document bodies are lossless markdown+HTML (lib/src/git_md.rs) covering the TipTap schema: headings, marks, lists, resource embeds, mentions, notes, tables. Export rewrites embed hrefs to localId; import rewrites them back to minted DIDs.
  • import_as_new_drive mints new DIDs the first time. import_into_drive is idempotent (same localIds → same DIDs).
  • Export → import → export is a no-op aside from exportedAt.
cargo run -p atomic_lib --features db-redb --example export_drive_git -- /tmp/atomic-drive-git
cargo test -p atomic_lib --features db-redb --lib -- git_md git_export

Git remains an interchange / readable backup. Vault keeps identity-preserving restore. Iroh/WS stay the sync path.

Sample document markdown

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 6 commits August 16, 2026 14:48
Adds planning/drive-as-git.md (snapshot export vs vault vs VFS, identity
vs path, why git is not a sync transport) and rewrites the public git
interop page around the atomic-git-export layout.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
atomic_lib::git_export walks a drive's parent tree and writes markdown,
file blobs, and JSON-AD plus a DID index under .atomic/. Optional git
init+commit. Import mints new DIDs (interchange, not identity restore).

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Serialize TipTap/ProseMirror JSON to deterministic markdown+HTML and parse
it back, including resource embeds, mentions, notes, and tables. Expose
Loro doc get/set so import can write a real document body.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Export sidecars without @id, rewrite in-drive refs to localId, and write
lossless document markdown. Import uses JSON-AD localId reservation,
inserts file blobs, and applies markdown bodies. Re-import into the same
drive keeps DIDs; export-import-export is a no-op aside from exportedAt.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Update the planning note, public git page, and coverage table for localId
identity, lossless markdown, and the export-import-export stability tests.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Git export now uses git_md; keep the previous ProseMirror walker only for
the tests that pin its output.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@cursor cursor Bot changed the title Explore exporting a drive as a git repository Reversible drive export as a git working tree Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants