Skip to content

Task copies of a local repository: mount --branch, --uncommitted, rm --unmount - #152

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

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

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Requested by George · project thread

A git: mount of a repository on this machine can now stand in for a second checkout, which is what an agent harness wants for each task (here, Sonny's per-task worktrees):

sandfs mount git:~/proj ~/tasks/fix-login --uncommitted --branch fix-login
cd ~/tasks/fix-login                       # ...work and commit...
git push origin fix-login                  # the branch is now in ~/proj
sandfs rm --unmount fix-login

Changes (CLI only, no core API change)

  • mount --branch NAME (git sources): writes .git/HEAD and .git/refs/heads/NAME into the new workspace, so git starts on a new branch at the mounted commit. Before this, a copy started on the branch checked out in the repository, and pushing back to it was refused (branch is currently checked out). The name has to pass git check-ref-format --branch, and a branch the repository already has is refused.
  • mount --uncommitted (local repository at HEAD): copies in, once, what the repository's folder has changed since HEAD, as git diff HEAD and git ls-files --others --exclude-standard list it: changed, staged, new and deleted files, links and the executable bit, but not ignored files. It handles a folder that replaced a file, and folders that a deletion emptied. Both git commands run with --no-optional-locks, so the repository is only read. In the copy, staged files show as unstaged. It is refused for remote and bare repositories, and for a commit other than HEAD.
  • rm --unmount: unmounts first if the workspace is mounted, and accepts the mount's directory. A plain rm of a mounted workspace now says to pass --unmount.
  • Both mount flags apply only when a workspace is created, like --read-only. If preparing the workspace fails, the new workspace is removed.
  • README, sandfs-cli README and the changelog are updated.

Testing

  • New mount test a_task_copy_carries_uncommitted_files_and_pushes_back_on_its_own_branch covers every kind of uncommitted change, frozen start, push back, each refusal, and rm --unmount.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check are clean. cargo test -p sandfs-cli passes on Linux FUSE, except the two sandfs shell tests, which need bubblewrap and this container doesn't have it. CI covers them.

Generated by Claude Code

…--unmount

A git: mount of a repository on this machine can stand in for a second
checkout. `--branch NAME` starts git in the copy on a new branch at the
mounted commit, so `git push origin NAME` brings its commits back without
touching the branches there. `--uncommitted` copies in, once, what the
repository's folder has changed since HEAD (changed, staged, new and
deleted files, links and modes; not ignored files). `sandfs rm --unmount`
unmounts and deletes a workspace in one step.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LAgZE9cvrECwdHFyP41Vd2
@lydakis lydakis self-assigned this Oct 26, 2026
@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-26T00:17:04.546136Z 5caf6e1 New commits
🔒 Security Review ✅ Completed 2026-10-26T00:23:51.028438Z 5caf6e1 New commits

Security findings

Advisory findings (1)

ℹ️ 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: e4e6f4c8db

ℹ️ 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 crates/sandfs-cli/src/git.rs Resolved
Comment thread crates/sandfs-cli/src/git.rs Resolved
Comment thread crates/sandfs-cli/src/git.rs Resolved
Comment thread crates/sandfs-cli/src/git.rs Resolved
…pipes

Prepare the copy before read-only paths apply (the mount applies them
again), check a remote's own branches rather than sandfs's copy's refs,
treat files below a file that replaced their folder as deleted, and leave
out pipes and devices instead of blocking on a read.

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

@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: c66ebe208b

ℹ️ 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 crates/sandfs-cli/src/git.rs Resolved

@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: d07692250d

ℹ️ 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 crates/sandfs-cli/src/git.rs Resolved
@lydakis
lydakis merged commit 7ead72d into main Oct 26, 2026
23 checks passed

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 5caf6e1e60

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread crates/sandfs-cli/src/git.rs Resolved
lydakis added a commit to lydakis/agent that referenced this pull request Oct 26, 2026
Only the lead works in its folder: every new task gets its own copy, read-only tasks included (those skip .agents/setup). How a task gets its copy is the client's preference: the app says worktree; Sonny's --copies worktree|sandfs or /copies sets it, kept in ~/.agent/sonny/settings.json, and /copies refreshes only instructions Sonny wrote. The coordinator role text gains the sandfs loops from lydakis/sandfs#152: in a git repo a frozen copy on agent/NAME whose commits are pushed back, outside git a copy whose changes are checked and copied back; a copy lives as long as its task.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014GXjqTZdBRLJAuNfCfvzXM
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