Repository navigation
Conversation
Git lists a worktree at its real path, so adding an untracked worktree by a path through a symlink, such as one under /var on macOS, was refused as not an untracked worktree of the project. Match the path against the suggestions with symlinks resolved, as the survey already does, and keep the suggestion's path on the workstream. A relative path is refused as before. The reconciler matched a session to a workstream or a suggestion by cleaned path as well. A session reported by another path to a folder was not counted on the folder's suggestion, and got an adopted workstream beside the one working there. - The reconciler keys the folders of a pass by their resolved paths. A workstream adopted for a folder keeps the path first reported. - One workstream owns a folder's sessions: the first that is no adopted one. An adopted workstream in a folder another works in is dropped, and its sessions go to that one. - The fake provider finds a project's sessions by their paths or with symlinks resolved, so a project added again by a path through a symlink finds the sessions it left running. It resolves on a copy of its session folders, with its lock released. - The provider and API test helpers use the worktree's path as git lists it, as the e2e helper already does. New tests go through a symlink, so they cover this on Linux as well. - The workstream note e2e spec polls for the note action. A created workstream gets its actions with a reconcile pass after it appears, and the spec read them at once. The fake's discovery takes a few milliseconds longer now, which made that race show. Fixes eclipse-enclave#27 Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
This agent never approves PRs. A maintainer must sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
Fixes #27. Git lists worktrees at their real path, so adding an untracked worktree through a symlinked path got a 409. Now addUntrackedWorktree matches the requested path against the suggestions with symlinks resolved (folderSet). The new workstream takes the suggestion's path, and a relative path is still refused.
The reconciler now groups sessions by resolved path instead of the cleaned path (folderSet.key, replacing cleanDir). It also picks one owner per folder (folderOwners / yieldsFolder): an adopted workstream in a folder that another workstream works in is dropped, and the owner takes its sessions.
What to look at
- Reconciler: the core change is the ownership logic in
reconcile.go. The new unit tests cover it well: matching across a symlink in both directions, one adoption for two paths to the same folder, and an adopted workstream giving way to the owner. I found no correctness bugs in the pass. - Fake provider vs. real providers: the fake now finds sessions through symlinks, and the new
project-remove.spec.tse2e case depends on that. The Enclave provider still decides which project owns a session by comparing path strings, so the real provider doesn't behave that way. A maintainer should decide whether Enclave gets the same treatment or whether the fake and the changelog note should be narrowed (see inline comments). - Paths still compared as strings: the store's folder checks (
workingDirTakenLocked,handOverTakenSuggestions) still compare paths as strings, as the description says. That stays consistent here only because the new workstream takes the suggestion's path.
Not verified
- No Go toolchain was available, so I couldn't run the unit tests.
- I skipped a browser check: the change is in the daemon and API, and the e2e API specs cover it.
Enclave reports a container's folders by their real paths, and git lists a worktree by its real path, but the Enclave provider matched them to a project's and its workstreams' folders by name. A project added by a path through a symlink, as under /tmp or /var on macOS, did not own its containers, so a CLI session in one of its untracked worktrees was never counted on the suggestion. The fake provider already found sessions through symlinks, so the e2e suite covered behaviour the Enclave provider lacked. ownsContainerIn and ownsDirIn now compare folders as they are first, then with symlinks resolved. Each resolution is remembered until the next inventory check, as the ownership check runs on every watch tick, some of the time with the bridges' lock held. The Enclave spec of a CLI session in an untracked worktree runs with the project added by its path and through a symlink, so it covers this on Linux as well. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review. May contain mistakes.
Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.
This agent never approves PRs. A maintainer must sign off.
Only a maintainer can re-request a review from this agent.
Powered by Eclipse Enclave via review-guard-mcp
Follow-up review of commit 737f0a0, which was pushed since my last review.
This commit makes Enclave's ownsContainerIn/ownsDirIn resolve symlinks too (new folderPaths cache, invalidated each inventory pass), closing the gap between the fake provider and the real Enclave provider. I checked the new unit tests (TestContainerOwnershipThroughASymlink, TestFolderPathsForgetASymlinkRetargeted, TestFolderPathsSame) and the updated enclave-cli-sessions.spec.ts, which now runs the untracked-worktree case both directly and through a symlink. Both match what the reply on my earlier threads described, and docs/ARCHITECTURE.md got a matching "Ownership" section. No Go toolchain was available again, so I couldn't execute the suite, but the logic and test coverage read correctly by inspection.
No new issues found in this commit. Nothing else changed since my last review.
These previous comments can be resolved as they are now handled:
- Enclave's container/folder ownership now resolves symlinks, matching the fake provider
project-remove.spec.tsnow reflects real provider behavior, not just the fake's
I can't resolve them myself as I would need write permission on this repository.
fismif
left a comment
There was a problem hiding this comment.
LGTM, approving. Thanks!
Verified locally: Go unit tests (also with -race, 3 runs), lint, and the API e2e specs all pass. The new tests fail against main's code, so they do cover #27.
Non-blocking nits:
folderPaths.sameholds its lock while resolving symlinks on disk, and some callers already hold the bridges' lock. A hung mount would stall every ownership check behind it.- The store still compares folders by name (
domain.SameFolder). If two non-adopted workstreams ever named one folder by different paths, the second would quietly get no sessions. I couldn't find a way to reach this through the API, so a follow-up is fine.
|
Hi @cdamus - this would need a little conflict resolution before merging. Whenever you have time. I can't do that myself unfortunately. |
# Conflicts: # webapp/apps/web-e2e/src/api/enclave-cli-sessions.spec.ts
The stub that stands in for Enclave in the OpenIDE test recorded $PWD, which Go sets to the command's directory as it was named. The test compares that with the temp dir's path with symlinks resolved, so it failed on macOS, where the temp dir is under /var, a symlink to /private/var. The stub now records `pwd -P`. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
|
Thanks @fismif I've pushed a merge to resolve the conflicts. When I ran the tests locally, I got the same kind of test failure again in a new TheiaIDE test that had been merged to |
What and why
Fixes #27
Git lists a worktree at its real path, so adding an untracked worktree by a path through a symlink was refused as not an untracked worktree of the project. The add now compares paths with symlinks resolved, as the survey already does. The reconciler does the same when it matches sessions to workstreams and suggestions, because a session reported by another path to a folder was otherwise not counted on the folder's suggestion and got an adopted workstream beside the one working there.
Notes for review:
path, not the path in the request. A relativepathis still409.folderSet.key), each path resolved once per pass. A workstream adopted for a folder keeps the path first reported, so a session under/var/…on macOS is not adopted at/private/var/….domain.SameFolder).ownsContainerIn), remembering each resolution until the next inventory check.workstream-note.spec.tsnow polls for thenoteaction. A created workstream gets its actions with a reconcile pass after it appears, and the spec read them at once. That race is onmaintoo, but the fake's slower discovery made it show in full e2e runs.Changelog
Checklist
AGENTS.md)AGENTS.mddocs/API.mdanddocs/ARCHITECTURE.md