Reversible drive export as a git working tree - #1279
Draft
joepio wants to merge 6 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
What this does
v2 of
atomic-git-exportis content-reversible:localId(existing property, else the export path). Sidecars have no@id; in-drive links are rewritten tolocalIds. Blob hashes staydid:ad:blob:{blake3}.lib/src/git_md.rs) covering the TipTap schema: headings, marks, lists, resource embeds, mentions, notes, tables. Export rewrites embed hrefs tolocalId; import rewrites them back to minted DIDs.import_as_new_drivemints new DIDs the first time.import_into_driveis idempotent (samelocalIds → same DIDs).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_exportGit 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.