Repository navigation
Preserve user state and validate identifiers without lossy aliases - #40
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
mazze93
marked this pull request as ready for review
September 26, 2026 17:28
…ases Preserve existing space-named state and main's LighthouseStore migration. Reject invalid CLI identifiers normally and refuse ambiguous legacy aliases before writing state. Move new regression coverage to separate test files. Local verification: diff whitespace and journal append-only checks pass. Swift/Xcode are unavailable in this cloud container; macOS CI remains required.
…lureTests #40 made SynapseCore.init(folderName:user:baseOverride:) throwing; the persistence-failure tests landed on main afterwards and called it without try, so CI failed to compile. Verified locally: swift build + swift test, 226 tests, 0 failures. Signed-off-by: Mazze LeCzzare Frazer <mazze@mazzeleczzare.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfxFgJK5GcRzMzXfgumDM8
mazze93
marked this pull request as draft
October 30, 2026 04:47
mazze93
marked this pull request as ready for review
October 31, 2026 01:22
# Conflicts: # docs/journal/DECISIONS.md
Resolve DECISIONS append-only conflict (main entries first). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 341d716. Configure here.
On a case-insensitive volume the stripped legacy name can match a directory spelled differently. The error then named an identifier that failed the exact-name check with conflictingOwner. Report the on-disk entry instead, and cover it with a regression test (skipped on case-sensitive volumes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCTAssertThrowsError's handler is non-throwing, so the follow-up validate call inside it failed to compile. Capture the reported key and assert on it after the throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.

Existing user names must retain their state without silently sharing directories. This repair reconciles the branch with current main and replaces lossy sanitization with validation of explicit identifiers.
Historical aliases cannot safely be assigned automatically: if users/AdaName exists and users/Ada.Name does not, selecting Ada.Name reports the ambiguity. The owner must select the stored name explicitly or back up and rename it. Existing data is left untouched.
Validation: local whitespace and journal append-only checks pass. Swift and xcodebuild are absent from the cloud container used for this repair; this says nothing about the maintainer's Mac. Native macOS CI and CodeQL have been triggered, and runtime tests are pending.
The PR should not merge until existing users named
DefaultorDEFAULTcan reopen their saved state.Fix with agent prompt
Summary
The PR preserves safe user names without dropping characters and returns recoverable errors for invalid names, conflicting owners, and ambiguous historical names.
Reviews (3) · Last reviewed commit: "fix(tests): mark throwing SynapseCore in..." · Reviewed by Greptile
Note
Medium Risk
Changes per-user persistence paths and initialization contract (throwing vs sanitized fatalError); incorrect validation could block access to existing data, though the expanded test matrix targets that perimeter.
Overview
Replaces lossy user-folder sanitization with
UserStorage.validateand a throwingSynapseCore(folderName:user:baseOverride:)so safe names (spaces, dots, punctuation) map to distinct directories and invalid or ambiguous inputs fail before any disk writes.CLI
--useris validated pre-init: malformed flags and rejected identifiers print to stderr and exit 2 without creating Application Support state.switchUserpropagates the same throws. The nonthrowing default initializer keeps GUI/source compatibility on"default".Validation covers path separators, legacy dot-stripped alias ambiguity, profile/directory owner mismatches, and Default/DEFAULT case rules (existing exact owners retained; new case variants of the built-in namespace blocked).
SynapticCircuitstops fault-propagation depth counting when the BFS frontier stalls (isolated nodes report depth 0). New tests cover storage, CLI integration, circuit regression, and updated persistence failure cases; conventions/journal entries document the boundary.Reviewed by Cursor Bugbot for commit 341d716. Configure here.