This repository was archived by the owner on Oct 16, 2026. It is now read-only.
Repository navigation
Reduce code-health debt: Swift format, dedupe, coverage (#26) - #45
Merged
Merged
Conversation
Adopt the Fleet Swift convention (4-space indent, 120 columns, as in pace, live and significanthobbies) and apply swift-format. Formatting is behavior-neutral: whitespace, line breaks, semicolon and multi-declaration splits only. Extract helpers from the parked v2 CompositeExporter.export (180 -> 97 lines) and share the add-only Photos save step between ScreenRecorder (v1) and RecordingController (parked v2) via PhotosVideoSaver. Messages, the add-only permission scope and state transitions are unchanged. Drop one unused SwiftUI environment read in SetupView. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the shared score-HUD preamble and hand-joint lookup into games/canvas-utils, removing the three TypeScript clone groups. Add behavior tests for the relay server (join/role enforcement, presence, direction-gated relay, ping, pose rate limit, send-after-close), the native JS bridge, the keyboard debug controller, canvas helpers, and the update logic of Reach & Dodge, Slice and Motion Maker (deterministic via a mocked Math.random). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coverage lines 6.4 -> 39.4, branches 10.06 -> 37.7, functions 7.01 -> 43.5, statements 6.49 -> 39.9; complexity violations 3 -> 2, max length 180 -> 149; duplication 5 groups / 65 lines -> 0; Swift format 4553 -> 8 diagnostics (now explicitly against .swift-format); Periphery 68 -> 66 findings. 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Progress on #26 (does not close it).
What changed
.swift-formatwith the Fleet Swift convention already used bypace,liveandsignificanthobbies(4 spaces, 120 columns, keep existing line breaks), then appliesswift-format format. The changes are whitespace, line breaks, and semicolon and multi-declaration splits only. The ratchet now passes--configuration .swift-formatexplicitly.SCREAMING_CASEconstants, which are kept because they mirrorprotocol.tsand dev config, and 1@retroactive IdentifiableonURL.CompositeExporter.export(parked v2) from 180 lines to 97 by extracting helpers for head-trim, the camera-inset transform, the video composition, the timeline and the export session.PhotosVideoSaver, used byScreenRecorder(v1) andRecordingController(parked v2). Messages, add-only permission and state transitions are unchanged.games/canvas-utils, which removes all 3 TS clone groups.Math.randomRatchets (before → after)
Checks
pnpm checkpasses: 17 files, 82 tests, format/lint/typecheck/build, plus the coverage, unused, complexity, duplication, cycles, dependency (0 critical/high), suppression and hygiene gates.xcodegen generate && pod install --deployment+xcodebuild ... CODE_SIGNING_ALLOWED=NO build) succeeds.pnpm quality:swiftpasses withMOTION_INDEX_STOREset (Periphery 3.8.0).Not done (still on #26)
PoseEstimator(buildAndEmit,computeHands). That is the live v1 Vision hot path, so I left it until it can be checked on a device.🤖 Generated with Claude Code