Skip to content

T-1: Introduce ProjectID canonical identity value type #194

@kirich1409

Description

@kirich1409

Part of EPIC #193.

Description

Introduce a ProjectID value type in MacApp/Packages/SharedModels/Sources/SharedModels/ProjectID.swift, wrapping a canonical absolute path string. Canonicalization: URL(fileURLWithPath:).resolvingSymlinksInPath().standardizedFileURL.path. Handles edge cases: ~/, trailing slash, symlinks, relative paths.

Acceptance Criteria

  • ProjectID is a public struct conforming to Hashable, Codable, Sendable, Equatable, CustomStringConvertible
  • Public constructors: init(url: URL), init?(path: String) (nil for empty / invalid)
  • Canonicalization: ~/foo, /Users/me/foo/, and a symlink to /Users/me/foo all produce the same ProjectID
  • Unit tests cover: symlink resolution, trailing slash normalization, ~/ expansion, empty / invalid string, APFS case sensitivity
  • Public rawValue: String for serialization
  • Build passes, swiftlint lint --strict clean, all existing tests pass

Module / Layer

SharedModels / Domain

Complexity

Small

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions