Repository navigation
Description
Summary
In the id REPL, the interactive find selection prompt (pkgs/id/src/repl/runner.rs:1110-1117) parses the typed selection with filter_map(|s| s.trim().parse::<usize>().ok()). Any token that fails to parse is silently dropped, and the command then acts on the remaining numbers as if the user had typed exactly those. A typo therefore does not stop the operation — it changes which blobs are fetched/printed/written, with no warning. Duplicate numbers are also kept, so the same blob is fetched and output once per duplicate.
The "invalid selection" message at :1118-1121 only fires when every token was dropped, which is exactly the harmless case. The harmful case — a mostly-valid line with one bad token — proceeds silently.
Evidence (verified this run)
Verbatim extraction of the :1110-1117 snippet (standalone rustc probe on the laptop, ~/git/fleet/probe-2026-10-28-laneB-replselect/, against main 6a284efd, 5 matches):
| Input | Parsed selections | Effect |
|---|---|---|
1 3 5 (control) |
[1, 3, 5] |
as typed |
1 x 3 |
[1, 3] |
x silently dropped; blobs 1 and 3 fetched |
1,three,2 |
[1, 2] |
three silently dropped |
2.9 4 |
[4] |
2.9 silently dropped (user plausibly meant item 2 or 29) |
99999999999999999999999 2 |
[2] |
overflowing token silently dropped |
1 1 |
[1, 1] |
duplicate kept: the output loops at :1129/:1140/:1148 fetch and emit blob 1 twice (in --dir mode it is fetched twice and printed to stdout twice) |
x (control) |
[] |
"invalid selection" — the only case that is reported |
Downstream, each surviving number is dereferenced as filtered_matches[n - 1] and passed to ctx.get(...) in all three output modes (:1129-1155), so a silently-altered selection set is a silently-altered set of file writes / stdout dumps.
This is the same bare-parse pattern the codebase has been removing elsewhere — strict, all-or-nothing validation with the dialog kept open on bad input in the web go-to-line control (#712), strict seed parsing (#707/#832), strict port parsing in bin/proxy-port.mjs. The REPL prompt is the remaining silent-drop site in this interaction class.
Why it matters
The selection prompt is the safety step between a search and bulk retrieval: the user confirms which matches to fetch precisely because acting on the wrong set is wasteful and, in --dir/file modes, writes files the user did not ask for. A parser that silently edits the confirmed set defeats that step — find with a fumbled keystroke retrieves a different set of blobs than the user confirmed, and duplicates repeat work and output.
Acceptance criteria
- Any non-empty token in the selection line that is not a valid in-range number makes the whole selection invalid: print "invalid selection" (or equivalent) and perform no fetches/output — no partial action on the surviving tokens.
- Duplicate numbers are either rejected the same way or deduplicated before acting; a blob is never fetched/output twice for one prompt answer. (Triage pins which.)
- Valid forms keep working unchanged:
1 3 5,1,2,3, mixed separators, surrounding whitespace, Enter to cancel. - The parse is extracted or otherwise unit-testable, with tests covering: control valid line, one bad token among valid ones, a fractional token, an overflowing token, duplicates, and all-invalid input.
- Existing REPL/find tests pass.
Found by new-issue-creator lane B, 2026-10-28 run. Dedup: gh search issues for "repl find selection", "selection prompt", "select numbers invalid selection" (open + closed) returned no matching issue.
Activity
developing-today commentedon Oct 28, 2026
CODE-924
dezren39 commentedon Oct 28, 2026
🤖 Agent note · filed
30 remaining items
dezren39 commentedon Nov 1, 2026
🤖 Agent note · parked
cargo test --lib parse_selectionin ~/git/fleet/5060/pkgs/id with the isolated target dir; if green, merge PR fix(id): strict all-or-nothing find selection parse (#1999) #3356, close this issue, complete task 5060 as fixed_merged.dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up (resume)
Merge pull request #3356 from developing-today/queue/5060-1999-find-s…
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done