uttrflow / uttrflow/uttrflow-swift

Coverage exclusions say each file is small enough to review by reading, but they include files of 1,930, 1,083, 770 and 689 lines with decisions in them

Open
#641 0 comments 0 reactions 0 assignees View on GitHub
area:general enhancement P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## What happens

`Scripts/coverage_report.py:27-29` sets the rule for `EXCLUDED_FILES`: "Files whose behaviour can only be exercised by real hardware or a real user. Each one must be small enough that reading it is a sufficient review." Nothing enforces the second sentence, and the largest excluded files on origin/main are:

| Lines | File | Stated reason |
|---|---|---|
| 1,930 | `Sources/Uttrflow/AppDelegate.swift` | assembles the real engines, windows and permission gates |
| 1,083 | `Sources/Uttrflow/Panel/QuickPanelView.swift` | SwiftUI, drawn from a tested presentation |
| 770 | `Sources/Uttrflow/Suggestion/SuggestionCoordinator.swift` | wiring only |
| 689 | `Sources/UttrflowLocalModel/MLXCandidateScorer.swift` | downloads gigabytes and runs GPU inference |
| 597 | `Sources/Uttrflow/Onboarding/OnboardingView.swift` | SwiftUI, drawn from a tested presentation |
| 584 | `Sources/Uttrflow/Dock/DockView.swift` | SwiftUI, drawn from a tested presentation |

Some of these hold decisions that a test could reach without hardware:

- `QuickPanelView.swift:911-940`: which ⌘-chords the panel takes (⌘Z undoes a delete, ⌘⏎ pastes plain, ⌘1–⌘9 pick a collection, anything else reaches the field), and that Escape closes an open row menu before it closes the panel.
- `MLXCandidateScorer.swift:235-292` and `404-597`: text helpers (`trimmed`, `joined`, `wholeWords`, `parse`, `echoes`, `continuation`, `repaired`, `isDegenerate`, ...) that never touch MLX.
- `SuggestionCoordinator.swift:556-577` and `752-770`: mapping a field snapshot to the model's situation and context.

#145 covers the app target's test gap in general; this is the narrower point that the exclusion list has no size check and has grown past its own rule.

## Why it matters

A newcomer is told coverage is 95% per module. Behaviour in these files is outside that number, and a change to the ⌘-chord handling or the completion text helpers passes the gate with no test.

## Acceptance criteria

- `coverage_report.py` prints each excluded file's line count, and fails (or warns, maintainer's choice) when an excluded file exceeds a stated limit, with the current over-limit files listed explicitly so the check starts green.
- A follow-up issue exists for each listed file whose decision logic can move into a tested module, starting with the panel's key handling (#630) and the scorer's text helpers.

Contributor guide

Open the contributing guide

Research direction

Start with Scripts/coverage_report.py:27-29 and trace how EXCLUDED_FILES is read and reported. Add the line-count check using the explicitly listed over-limit files as the initial green baseline, then verify that the script prints counts and warns or fails as required. Note the requested follow-up issues for QuickPanelView.swift and MLXCandidateScorer.swift decision logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, swift
Domain
testing, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.