uttrflow / uttrflow/uttrflow-swift

FieldSituation, PredictStore.successors and importShellHistory are tested but never called by the app: 335 lines of AI suggestion ranking that nothing uses

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

Description

## What happens

Three pieces of `UttrflowPredict*` are public, tested, and unreachable from the app:

- `Sources/UttrflowPredict/FieldSituation.swift` (81 lines), `FieldSituationReading.swift` (230) and `FieldSituationWeighting.swift` (24). Outside those three files, `git grep -w` finds no reference in `Sources/`; `FieldSituationReading` has 75 references in tests. It came back in f59972b ("Recovers the situation half of feat/predict-situation") and was never wired into ranking. No document mentions it.
- `PredictStore.successors(for:after:)`, `Sources/UttrflowPredictStore/PredictStore.swift:140`, is the only producer of `Candidate.Source.succession`. The succession table is written but no production code queries it (5 test references).
- `CaptureSession.importShellHistory(forHomeDirectory:into:at:)`, `Sources/UttrflowPredictCapture/CaptureSession.swift:83`. `ShellHistory` and `CapturePreferences.hasImportedShellHistory` are reachable only through it (4 test references).

## Why it matters

A contributor looking at how AI suggestions rank candidates finds three plausible mechanisms, and cannot tell from the code or `Docs/predict.md` that none of them runs. Each one is also coverage the module's floor must keep paying for.

## Decision needed

For each: wire it in (with a measurement that it helps, e.g. in the bake-off fixtures), or delete it and its tests. Until then, a one-line note in `Docs/predict.md` saying they are not used would stop them misleading.

## Acceptance criteria

- A decision for each of the three is recorded on this issue.
- The code matches the decision, and `Docs/predict.md` describes only what runs.

Contributor guide

Open the contributing guide

Research direction

Start with Docs/predict.md and inspect the three named Swift files, their production references, and related tests using the issue’s git-grep findings. Run the relevant prediction and capture tests before changing anything. Done means each mechanism has a recorded decision, code and tests match those decisions, and Docs/predict.md describes only behavior that runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
developer-experience, documentation
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.