Skip to content

Quality Pass: Data Persistence / Storage #68

@dhilgaertner

Description

@dhilgaertner

Parent: #53

Scope

JSON-based persistence layer for sessions, worktrees, links, and terminals. Thread-safe store with atomic writes, backup on corruption, and migration support.

  • Refactoring — identify and address code quality improvements
  • Documentation — ensure adequate inline and user-facing docs
  • Code Review — thorough review for correctness, edge cases, security
  • Testing — add/improve tests for key functionality

Key Files

  • Packages/CrowPersistence/Sources/CrowPersistence/JSONStore.swift — thread-safe store at ~/Library/Application Support/crow/store.json
  • Packages/CrowPersistence/Sources/CrowPersistence/Repositories/SessionRepository.swift — session repository
  • Packages/CrowCore/Sources/CrowCore/Models/Session.swift — Codable session model
  • Packages/CrowCore/Sources/CrowCore/Models/Terminal.swift — terminal model with backward-compat decoding

Areas of Interest

  • Thread safety via NSLock
  • Atomic writes (prevent corruption on crash)
  • Backup strategy (.bak on decode failure)
  • ISO8601 date encoding, sorted keys, pretty-print
  • File permissions (0o600 owner-only)
  • StoreData schema (sessions, worktrees, links, terminals)
  • Backward-compatible decoding (e.g., missing isManaged field defaults)
  • Migration from old "rm-ai-ide" app support directory

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions