GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(repl): a non-numeric --first/--last/--lines value silently becomes a search query — 'find report --first two' searches for 'two' too, truncated to 1 · Issue #2009 · developing-today/code

id(repl): a non-numeric --first/--last/--lines value silently becomes a search query — 'find report --first two' searches for 'two' too, truncated to 1 #2009

New issue
Copy link
New issue
Copy link
Closed
#4072
Closed
id(repl): a non-numeric --first/--last/--lines value silently becomes a search query — 'find report --first two' searches for 'two' too, truncated to 1#2009
#4072
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobstatus:in-reviewtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Problem

In the id REPL, a non-numeric value after --first / --last (and after --lines in peek) is silently reinterpreted as a search query, and the limit silently falls back to 1 (or, for --lines, to the default 5). No error or warning is printed anywhere — the parsers return only a struct.

  • pkgs/id/src/repl/runner.rs:675-700 — parse_find_args (used by REPL find, search, and show): when the token after --first/--last does not start with - and fails parse::<usize>(), the branch sets first/last = Some(1) ("default to 1") but does not consume the token (i += 1 happens only on parse success). The loop then reaches that same token, it does not start with -, and the final branch pushes it into args.queries.
  • pkgs/id/src/repl/runner.rs:1190-1213 — parse_peek_args repeats the identical --first/--last shape, with the same fall-through into find_args.queries.
  • pkgs/id/src/repl/runner.rs:1216-1223 — parse_peek_args' --lines/-n branch is worse in one way: on parse failure it sets nothing and consumes nothing, so the bad token again becomes a query and lines silently stays at the default 5.

Verified this run (2026-10-28, main d069a613)

Probe compiled and run on the laptop (~/git/fleet/probe-2026-10-28-laneA-replfirst/ there; the --first/--last/query branches and loop increment copied verbatim from parse_find_args):

  • Control ["report", "--first", "5"] → queries=["report"] first=Some(5) ✓
  • Control ["report", "--first"] → queries=["report"] first=Some(1) ✓ (documented bare-flag default)
  • ["report", "--first", "two"] → queries=["report", "two"] first=Some(1) — the typo became a second search term and the result set was narrowed to 1
  • ["report", "--last", "abc"] → queries=["report", "abc"] last=Some(1)
  • ["--first", "two", "report"] → queries=["two", "report"] first=Some(1)

So find report --first two does not fail, does not warn, and does not search what the user asked: it searches for report AND two, truncated to the first match (apply_search_options, runner.rs:987-1013, applies the limit after collecting matches for all queries).

Why it matters

A one-character-class typo in an interactive session silently changes which blobs are searched for and how many come back — the same silent-reinterpretation class as #1999 (selection prompt dropping unparseable numbers), one parser earlier. The REPL is the surface where users type these flags by hand, so typos are the common case, not an edge case.

Acceptance criteria

  • A non-numeric token following --first/--last in parse_find_args and parse_peek_args, or following --lines/-n in parse_peek_args, is never added to queries and never silently defaults the limit: the command reports the bad value (usage/error line naming the flag and the token) and runs no search, OR the triage-pinned contract is documented in the help text and implemented identically in both parsers.
  • The bare-flag form (--first with no following token, or followed by another flag) keeps its documented default of 1.
  • Regression tests in runner.rs cover at least: ["q", "--first", "two"], ["q", "--last", "abc"], and peek ["q", "--lines", "abc"] — asserting the bad token is not in queries and the failure is surfaced; existing parser tests (runner.rs:1540+) still pass.
  • Both parser copies behave identically (find/search/show and peek), so the fix is not applied to only one copy.

Filed by new-issue-creator-code-a. Related: #1999 (same REPL, same silent-parse class, different site).

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-930

  2. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/lowNice to have; do when convenient
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a run 2026-10-28 19:05 CDT
    • Found via: filed this run
    • Task: REPL --first/--last/--lines non-numeric value silently becomes a search query and the limit silently defaults — verified with a verbatim-branch probe on the laptop (main d069a61)
    • Expectation: effort xs; done when a bad numeric flag value is surfaced (never added to queries, never silently defaulted) in both REPL parsers, with regression tests
    • Links: evidence in the issue body; probe ~/git/fleet/probe-2026-10-28-laneA-replfirst/ (laptop)
  4. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  6. 4 remaining items

  7. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  8. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: queue task 2927 · ses_e5e6a60cf8dffecSfMUJVJZuE8
    • Found via: repo-health-code-pilot atomic claim
    • Task: Triage issue id(repl): a non-numeric --first/--last/--lines value silently becomes a search query — 'find report --first two' searches for 'two' too, truncated to 1 #2009.
    • Outcome: Confirmed the malformed-value bug on current main and pinned the parser contract in the triage note above.
    • Follow-up: Small-fix queue task 5075 is queued for the two REPL argument parsers and regression tests. Task 5060/id(repl): find selection prompt silently drops unparseable numbers — a typo changes which blobs are fetched, and duplicates fetch twice #1999 remains a separate selection-prompt change; follow-up 5075 calls out the shared file to avoid concurrent edits.
    • Tests: Targeted cargo test --lib repl did not reach test execution; both attempts timed out while compiling dependencies.
    • Links: queue task 5075 (repo-health-code-pilot); detailed verdict and evidence in the triaged note above.
  9. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 1, 2026
  10. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e66a8a4b3ffexvJwMlYfwxCT · queue task 5075
    • Found via: repo-health-code-pilot atomic claim
    • Task: Fix malformed numeric flags in the REPL find/peek argument parsers.
    • Expectation: Reject invalid --first/--last values in both parsers and invalid peek --lines/-n; preserve bare --first/--last defaulting to 1.
    • Next: Create the task worktree, inspect current parser/tests, implement scoped regressions, and run targeted REPL tests. Related task 5060 owns selection-prompt parsing in the same file and remains out of scope.
  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  12. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e66a8a4b3ffexvJwMlYfwxCT · queue task 5075
    • Found via: repo-health-code-pilot atomic claim
    • Task: Reject malformed numeric limit flags in the REPL find/peek parsers.
    • Outcome: PR fix(id/repl): reject nonnumeric result limits #4072 opened: fix(id/repl): reject nonnumeric result limits #4072. Invalid --first/--last values now error in both parsers; invalid peek --lines/-n values error before search; bare first/last defaults remain 1.
    • Tests: cargo test --lib repl passed (140 id tests + 3 id_core tests); targeted rustfmt and diff checks passed.
    • CI: No pending CI checks at completion; CodeRabbit status was neutral. Issue remains open until PR merge.
  13. dezren39
    added 2 commits that reference this issue on Nov 2, 2026

    fix(id/repl): keep output redirection after bare --first/--last (#2009)

    5095af5

    fix(id/repl): reject nonnumeric result limits (#4072)

    c8a2191
  14. dezren39
    closed this as completedin #4072on Nov 2, 2026
  15. developing-today
    added
    status:in-review
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobstatus:in-reviewtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.