Skip to content

pm search <exact-id> returns the item but ranks it BELOW body-mention matches (no ID-exact boost) #281

Closed

Description

@unbraind

Bug description

pm search <exact-id> now returns the matching item (so #268's zero-results case is fixed — thanks), but the exact-ID match is ranked below unrelated items that merely mention the ID in their body/description. An exact ID match should rank #1.

Reproduction (2d-bots tracker, ~1463 items)

$ pm search pm-16xj --path .agents/pm
query: "pm-16xj"  mode: "keyword"
  - id: pm-nvfo   score: 10   # mentions "pm-16xj" in its description
  - id: pm-ymxx   score: 9    # mentions "pm-16xj" in body
  - id: pm-7h7c   score: 7
  - id: pm-uokx   score: 5
  ...                              # the ACTUAL item pm-16xj is buried further down

$ pm search pm-dq3g --path .agents/pm
  - id: pm-lfbj   score: 10   # mentions pm-dq3g in body
  - id: pm-vq2f   score: 6
  - id: pm-fx11   score: 6
  ...                              # the actual item pm-dq3g is not in the top results

--match-mode exact changes tokenization, not ranking, so it does not help.

Expected behavior

When the query string exactly equals (or equals minus the pm-/id-prefix) an item's ID, that item should receive a large ID-exact relevance boost and be returned first, ahead of body/description-mention matches.

Actual behavior

The exact-ID item scores low and is buried beneath items that only mention the ID in their prose.

Environment

pm-cli latest; tracker 1463 items. Adjacent to but distinct from #268 (#268 = exact-ID search returned zero results; this = exact-ID search returns the item but mis-ranks it).

Impact

Low-medium. Scripts/humans doing pm search <id> to confirm an item exists still work, but the natural "the first result is the thing I asked for" expectation is violated, and the target can fall below the result cap.

Activity

  1. unbraind commented on Jul 11, 2026

    @unbraind
    OwnerAuthor

    pm tracker item:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpm-cli

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions