Skip to content

End-to-end review: dedup + graph-engine tests, VM import fix, Dashboard doc resync - #45

Merged
mayeack merged 1 commit into
mainfrom
claude/review-tests-and-doc-sync
Jun 2, 2026
Merged

mayeack merged 1 commit into
mainfrom
claude/review-tests-and-doc-sync

Conversation

@mayeack

@mayeack mayeack commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Full end-to-end code & design review of Blackbook (17 KLOC, 45 Views, 19 Services). The complete findings report is committed at docs/CODE_REVIEW_2026-06-02.md. This PR lands the safe, in-scope fixes the review surfaced; larger/riskier items are documented for follow-up PRs.

Headline: the codebase is healthy

  • MVVM/@observable applied consistently; NavigationStack discipline correct (no double-back-chevron — detail bodies are clean, only sheets own stacks); hidden-contact filtering present everywhere; no off-actor SwiftData access (the recent crash class is absent); no bare Group{}, no print().

Fixed here

  1. ContactListViewModel: removed dead import SwiftUI — it used zero SwiftUI symbols; violated "ViewModels never import SwiftUI."
  2. Dashboard.md resynced with DashboardView — PR Fix iOS launch crash: decouple Dashboard from @Query + atomic pull apply #43 changed the view (@Query@State, "Dashboard"→"Overview", ProgressView gate, sync-completion refresh, prioritizeCard) without updating the page doc, breaking the mandatory page-doc-sync rule.
  3. +24 unit tests for two untested, pure-logic services:
    • ContactDeduplicationServiceTests (14) — safety-critical auto-merge logic: union-find linking by name/email/phone, transitive components, merged-away exclusion, data-richness primary selection, mergeAll mutation path.
    • NetworkGraphEngineTests (10) — graph build, dangling-edge rejection, tag filtering, simulation convergence + NaN-safety.
    • One test is a regression guard documenting a real nameKey whitespace limitation (report Add centralized backup storage, fix macOS crashes, add login gate #5).

Tests: 195 → 219, all green on iOS + macOS. No production behavior change beyond the dead-import removal.

Documented for follow-up (NOT in this PR — see report)

Test plan

  • iOS Simulator (iPhone 17): 206 XCTest + 13 Swift Testing pass
  • macOS: build clean
  • xcodegen generate registered both new test files
  • CI green

🤖 Generated with Claude Code

…ashboard doc

End-to-end review pass. Findings documented in docs/CODE_REVIEW_2026-06-02.md.

Changes (the safe, in-scope fixes):
- ContactListViewModel: drop dead `import SwiftUI` (it used no SwiftUI symbols;
  violated the "ViewModels never import SwiftUI" rule).
- .cursor/pages/Dashboard.md: resync with DashboardView after PR #43 (was stale —
  @query@State manual fetch, title "Dashboard"→"Overview", ProgressView gate,
  .blackbookSyncDidComplete refresh, added the prioritizeCard). Satisfies the
  mandatory page-doc-sync rule that PR #43 missed.
- +24 unit tests for two previously-untested, pure-logic services:
  - ContactDeduplicationServiceTests (14): union-find linking by name/email/phone,
    transitive components, merged-away exclusion, data-richness primary selection,
    and the mergeAll mutation path. This service auto-merges contacts and was
    safety-critical with zero coverage.
  - NetworkGraphEngineTests (10): graph build, dangling-edge rejection, tag
    filtering, simulation convergence + NaN-safety.
  - One test (testNameKeyDoesNotTrimInnerWhitespace) is a regression guard that
    documents a real nameKey limitation flagged in the report (#5).

Test count 195 -> 219, all green on iOS + macOS. No production behavior change
beyond the dead-import removal. The report's remaining findings (service-layer
sync test coverage, .caption2 rule-vs-reality, nameKey whitespace, stale rules.md
Icon-1 section, EntityListRow adoption, dead LocalSyncServer.swift) are left for
follow-up PRs with rationale.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mayeack
mayeack merged commit 9ffb129 into main Jun 2, 2026
2 checks passed
@mayeack
mayeack deleted the claude/review-tests-and-doc-sync branch June 2, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant