uttrflow-dev probe surface --seconds and probe retrieval --entries crash on negative values

Open Beginner friendly
#511 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
cli

Research direction

Read CONTRIBUTING.md, then inspect the probe commands in Sources/uttrflow-dev/Probe.swift and compare their validation patterns with Sources/uttrflow-dev/Bench.swift and Record.swift. Check that negative and zero values are refused with allowed-range messages, valid values remain unchanged, and run the documented probe commands plus make verify.

Written by the indexing model from the issue text.

Description

area:ai-suggestions area:build bug good first issue P2

What happens

  • probe surface (Sources/uttrflow-dev/Probe.swift:23-24) loops for tick in 0..<seconds at line 38. A negative --seconds makes an invalid range and traps.
  • probe retrieval (Probe.swift:75-76) calls RetrievalBenchmark.corpus(entries), which maps over 0..<count (Sources/uttrflow-dev/RetrievalBenchmark.swift:89). A negative --entries traps the same way; 0 runs and prints meaningless timings.

bench, record, transcribe and insert in the same tool already have a validate() for their numbers.

How to check

Read the two lines above; 0..<-1 is not a valid Range.

Acceptance criteria

  • probe surface refuses --seconds below 1, and probe retrieval refuses --entries below 1, each in a validate() with a message naming the allowed range.
  • Valid values behave exactly as today.

Where to start

  • Sources/uttrflow-dev/Probe.swift
  • validate() in Sources/uttrflow-dev/Bench.swift:32 or Record.swift:19 is the pattern to follow.
  • Tests to extend: there is no test target for uttrflow-dev; describe the commands you ran in the pull request. probe retrieval needs no permissions; probe surface needs Accessibility, so for that one checking --seconds -1 is refused is enough.
  • Before pushing, run make verify (export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer first). It is the same command CI runs, and it enforces the 95% coverage floor per module.
  • Read CONTRIBUTING.md first, and say on this issue that you are taking it.

Size: XS to S, about 1 hour.

Dominant language
Swift
Stars
4
Forks
17
Avg merge
18h 15m
Merged PRs (30d)
442

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uttrflow/uttrflow-swift

All issues in uttrflow/uttrflow-swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.