Skip to content

Copies of plain folders, landing back into the folder; sync in place - #3

Merged
lydakis merged 4 commits into
mainfrom
claude/project-thread-wdmsae
Oct 26, 2026
Merged

lydakis merged 4 commits into
mainfrom
claude/project-thread-wdmsae

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner

What changes

Graft now works on plain folders as well as GitHub repositories, which Sonny needs. sync also stops unmounting the copy.

Plain folders. gft get ./notes (or any folder path) turns a folder that isn't a git repository into a project, and the folder itself is the home copy.

  • gft new NAME makes notes+NAME: a sandfs fork of the folder as it is at that moment. The files are cloned, so they take no space, but this needs APFS, btrfs or XFS.
  • gft land writes the copy's changes into the folder with sandfs changes --copy-to. If the folder changed one of those files since the copy was made or last synced, the whole landing is refused. After a successful landing the copy moves onto the folder as it is now, so it has no changes left.
  • gft sync moves the copy onto the folder as it is now. A file changed on both sides keeps the copy's version and is listed, because a folder keeps no older version to merge from.
  • ls, status, changes, save, undo and rm work as before. Projects are stored as folder/NAME.
  • land -m/--body/--draft and changes on the folder itself are refused with a clear message.
  • A folder that is a git repository is pointed at gft get OWNER/NAME.

Sync in place. sync calls sandfs update on the mounted copy and no longer unmounts it. A shell or agent working inside the copy carries on. This depends on lydakis/sandfs#166, and the README's Needs section says so.

CI

The plain-folder test needs a disk that clones files. The workflow now mounts a small btrfs loop disk and points TMPDIR at it; elsewhere the test skips with a message. CI will only run once the repo is public.

Tests

  • New test copies_of_a_plain_folder_land_back_into_it covers:
    • making copies, with the folder's later edits staying out of them;
    • changes, and syncing from inside the copy with a shell running there;
    • landing, after which the folder has the changes and the copy has none;
    • a landing refused when the folder changed the same file, and nothing written;
    • sync then reporting the file as changed on both sides, and landing again writing the copy's version;
    • rm.
  • The repository test now syncs with a shell sitting in src/.
  • Local checks: cargo fmt, clippy -D warnings and cargo test with GRAFT_REQUIRE_SANDFS=1 pass against sandfs built from #166, with TMPDIR on btrfs. On ext4 the folder test skips as intended.

Generated by Claude Code

gft get FOLDER makes a plain folder a project whose home copy is the folder
itself. Its copies are sandfs forks of the folder as it is when made, land
writes their changes back into the folder (refused if the folder changed one
of those files since), and sync moves them onto the folder as it is now.

sync no longer unmounts: sandfs moves the mounted copy in place, so an agent
can sync from inside its copy while its programs keep running there.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T02:59:43.810407Z cae9a05 New commits
🔒 Security Review ✅ Completed 2026-10-26T03:01:27.148469Z cae9a05 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 234c29cd48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs Resolved
undo compares a copy's base with a snapshot's to decide whether it can
restore in place, so two bases taken in one second must differ. Folder
bases are now SECONDS.NANOS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04092d8eb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs Resolved
A folder project may sit inside another one; commands inside the inner
one used to reach whichever project came first.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq

lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

CI is red, and it is expected for now. CI installs sandfs from main. gft sync now updates a mounted copy in place, which needs lydakis/sandfs#166, not yet merged. Without it, sandfs main refuses with "is mounted; unmount it first", and both workflow tests stop at their first sync. The plain-folder test does get that far on the btrfs disk, so the CI setup itself works. Both tests pass locally against the #166 branch. Once #166 merges, I'll push here so CI runs against it, then merge on green.


Generated by Claude Code

@lydakis
lydakis merged commit 8231fa7 into main Oct 26, 2026
2 checks passed
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