Repository navigation
fix(control): resolve single session when Claude accounts share folders by symlink (#350) - #376
Merged
Merged
Conversation
Accounts that link projects/ and sessions/ to one config dir each find the same transcript and the same live record, so resolveHome counted every one of them live and refused ambiguous_home. Where every live copy is one file on disk and every live record one registry file, take that session, filed under the account whose own folders hold it. Two files, two processes, or nothing live still refuses (spec/CONTROL.md section 6.1). Fixes #350 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ilya Fomin <2030645+fominfo@users.noreply.github.com>
…lane too The inbox lane looks the live record up across every account, and with sessions/ linked each account read the same registry file, so liveRecord found one row per account and returned null: no_record, and the message went to a fork instead of the live window. liveRecords now keeps one row per real registry file, named for the account the session was resolved to, so a second process in another account still refuses and other_home still compares the right accounts. A daemon test writes through linked homes into the inbox; spec section 6.1 covers the all-links case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ilya Fomin <2030645+fominfo@users.noreply.github.com>
… branch - Add conformance/control-homes.json covering CONTROL.md §6.1 Homes (single, missing, one-live, ambiguous, linked-to-owner, all-links fallback, cold linked, and linked projects with two live registries), driven by packages/core/test/claude-live-record.test.ts. - Cover the all-links fallback branch in oneThroughLinks and mark the two TOCTOU catch fallbacks in realOf/linkedFolder with v8 ignore so 100% coverage holds. - Compare prefer with path.resolve in liveRecords to match vetInbox, and list sessionpipe alongside sessionpipe-core in the changeset. Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…nd edge-case coverage - Capture liveRecords once in resolveHome and pass the snapshot into oneThroughLinks to avoid double disk scans and eliminate the TOCTOU race where a second account's registry row vanishes between the two reads. - Check lstatSync(path.resolve(p)) on configDir itself (not only projects/ and sessions/) so a whole-config-dir symlink prefers the real owner, and treat lstatSync errors as non-owning rather than owning. - Use NTFS junctions on win32 in packages/core/test/claude-live-record.test.ts so linked-home and conformance tests run cross-platform without elevation; guard Unix-only file-symlink and ELOOP cycle tests with it.runIf(unix). - Expand conformance/control-homes.json (and document it in conformance/README.md) plus unit/daemon tests covering dangling symlinks, ELOOP cycles, split-ownership and whole-dir links, two real transcripts with linked sessions/, two live processes in shared sessions/, all-links daemon inbox delivery, no_record / other_home refusals, and cancel() with linked homes. Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
5 tasks done
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.
Rebases #351 cleanly onto
main(preserving @fominfo's original commits and DCO sign-off) and adds hardening from QA stress-testing:liveRecordsonce per account inresolveHome/oneThroughLinksto eliminate TOCTOU race and duplicate disk scanconfigDirsymlinks vialstatSync(path.resolve(p)).isSymbolicLink()(and fails safe on error)junctionfor directory symlinks in Windows tests and guards Unix-onlyELOOP/file-symlink cases cleanlyconformance/control-homes.jsonand daemon inbox/cancel()/other_home/no_recordtests at 100% coverageQA verified (Claude Opus 5.5): PASS (0 blockers, 0 high, 9 adversarial stress tests passed, 4,901 tests at 100% coverage).
Closes #350
Supersedes #351