Problem
Auth/AccountId.cs and Auth/DriveId.cs define sealed record (reference types). Canonical versions of the same concepts already exist as readonly record struct (value types, stack-allocated) in Persistence/ValueObjects/AccountId.cs and Persistence/ValueObjects/DriveId.cs.
This creates two competing types for the same domain concept with different semantics, allocations, and equality behaviour. onedrive-persistence.md is explicit: "Always readonly record struct — value semantics, no null, stack-allocated."
Required fix
- Delete
Auth/AccountId.cs and Auth/DriveId.cs
- Update
Domain/OneDriveAccount.cs and Auth/AuthResult.cs to use the canonical types from Persistence/ValueObjects/
- Update all call sites in
Auth/AuthService.cs, Wizard/AddAccountWizardViewModel.cs, Workspace/WorkspaceViewModel.cs etc. to reference the single canonical namespace
- The factory method on
Auth/AccountId (Create(string)) should not be needed — construction is direct: new AccountId(value) as per the value-object convention
Rule reference
@.claude/rules/onedrive-persistence.md — Strongly-typed domain value types
Problem
Auth/AccountId.csandAuth/DriveId.csdefinesealed record(reference types). Canonical versions of the same concepts already exist asreadonly record struct(value types, stack-allocated) inPersistence/ValueObjects/AccountId.csandPersistence/ValueObjects/DriveId.cs.This creates two competing types for the same domain concept with different semantics, allocations, and equality behaviour.
onedrive-persistence.mdis explicit: "Alwaysreadonly record struct— value semantics, no null, stack-allocated."Required fix
Auth/AccountId.csandAuth/DriveId.csDomain/OneDriveAccount.csandAuth/AuthResult.csto use the canonical types fromPersistence/ValueObjects/Auth/AuthService.cs,Wizard/AddAccountWizardViewModel.cs,Workspace/WorkspaceViewModel.csetc. to reference the single canonical namespaceAuth/AccountId(Create(string)) should not be needed — construction is direct:new AccountId(value)as per the value-object conventionRule reference
@.claude/rules/onedrive-persistence.md— Strongly-typed domain value types