Repository navigation
cellstore: each codeaf home gets its own private saving daemon - #2017
Merged
Merged
Conversation
AbirAbbas
added a commit
that referenced
this pull request
Oct 28, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas
force-pushed
the
fix/app-home-workspace-seal
branch
from
October 28, 2026 20:18
3523de9 to
fcb49f0
Compare
Windows started every engine's furrow daemon on a socket named only by the
build, so two engines with different homes (desktop and terminal, or two
homes) bound the same endpoint and broke each other's seals ("use of closed
network connection"). The socket now carries the home and the build: same-
home clients still share one daemon, different homes never collide, and the
address stays under the AF_UNIX limit, falling back only to the user's own
temp folder with a private ACL. With no private bounded endpoint, saved file
history turns off with one plain sentence instead of failing every seal.
On Unix a long home used a predictable /tmp socket that nobody checked.
Short endpoints now prefer $XDG_RUNTIME_DIR, then the in-home path, then a
validated private temp directory (current uid, 0700, no symlinks, socket
owned by the user), and preclaimed or foreign endpoints are skipped before
dialing or pruning. Stale endpoints are pruned only under the daemon's start
lock, and the next seal still re-dials after a dropped connection.
Two gaps in the home-folder policy are closed: an unset HOME falls back to
the login home, and the ancestors of a symlinked home's original path count,
so neither can make a chat walk the profile.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas
force-pushed
the
fix/app-home-workspace-seal
branch
from
October 28, 2026 20:31
4e08732 to
76625b4
Compare
…s used The Unix selector preferred $XDG_RUNTIME_DIR, so after an upgrade a home whose daemon an older engine had started got a second daemon on a new address for the same store. A home whose own address fits keeps it again; a long home keeps the short alias earlier engines used while it is a private directory of this user, and only a preclaimed alias falls to the private runtime directory and then other private candidates. A regression starts the old daemon, upgrades the client and checks both seals share one daemon. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas
force-pushed
the
fix/app-home-workspace-seal
branch
from
October 28, 2026 20:33
76625b4 to
0243b47
Compare
The Unix short alias hashed the home as spelled, so a long home reached through a relative path or a link got its own daemon beside the one its absolute spelling started. It is keyed by the canonical home now, which for an absolute home without links is the key earlier engines used. The tests that need a real engine skip, like the package's others, when the build has none. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Why
Found while building a real app with the desktop app on Windows. Every engine started
furrow serve --socket <per-user dir>/e-<build hash>.sock, and that name doesn't depend on the home. So two engines with different homes (desktop and terminal, or two homes) bound one socket and broke each other's seals ("use of closed network connection").The same run found a crew whose workspace was the home folder; saved history then walked the whole user profile. #2009 has since landed its own home-folder policy upstream. This PR drops its earlier version of that and keeps only two gaps the policy still had.
Change
One saving daemon per home.
e-*.sockendpoints are pruned only while holding that daemon's lifetime lock, inside the existing per-socket start gate.The address stays under the AF_UNIX limit:
$XDG_RUNTIME_DIRand then to other validated private temporary directories.Two holes in the home-folder policy are closed:
HOMEunset, the check falls back to the login home.Verified
internal/cellstorepackage passes with the pinned furrow fixture. That includes a regression that starts a daemon on the old long-home address, upgrades the client, and checks that both seals reach the same daemon PID.go vet(Linux andGOOS=windows) andgofmtare clean.cellstore.test.exe, real furrow): 171 tests passed, 12 skipped (Unix-only fixtures). That covers the home/build socket identity, the user-temp-only fallback, a deepLOCALAPPDATA, case and trailing-separator homes, two homes sealing concurrently and restarting, pruning only dead sockets, recovery after an interrupted answer, and the no-private-socket fallback.TestGoldenWALRecords(relativetestdata),TestL2OnlyNewTurnConstructsATurn(temp-dir access) andTestComposedDirIsNamedOnlyWhenTheTreeIsAWorkspace(\\?\prefix). Those come from running the binary outside the package directory, not from this change.Not run here: the macOS runtime.
🤖 Generated with Claude Code