Indexes a repo's files and ranks the ones most relevant to a given issue — a reusable "which files matter here" step, designed for reuse by later MyThingsLab tools (MyGroomer, MyCoder) that need relevant-file context before acting.
Deterministic pre-work:
- Walk the repo tree via
git ls-files, building a lightweight index: path- top-level identifiers (function/class names via
ast.parsefor.py; a best-effort grep of exported symbols for other languages).
- top-level identifiers (function/class names via
- Tokenize the issue title/body.
- Score every indexed file by naive term overlap between issue tokens and {path components ∪ identifier names}.
- Take the top N (default 20) by score as the candidate shortlist — this bounds the Engine prompt and keeps the tool cheap even on a large repo. If nothing scores above zero, fall back to the most-recently-modified files rather than an empty shortlist.
If the shortlist has at least 2 candidates, the one Engine call reorders
it by relevance — a permutation of the shortlist, never a new path (anything
the model invents outside the shortlist is dropped; anything it silently
drops is appended back, preserving order). Against NoopEngine, the reply is
empty and the deterministic pre-ranking order is returned unchanged.
No Workspace worktree — read-only over the repo tree, no edits, no PR. The
only side effect is an optional --comment, which posts the ranked list to
the issue as Action(kind="bash", ...) routed through Policy (ALLOW by
default). Writes exactly one kind=search ledger entry per run.
mysearcher rank --issue 12 --source . [--repo owner/name] [--top 20] [--json]
mysearcher rank --issue 12 --repo owner/name --comment # also posts the ranked list
mysearcher rank --issue 12 --engine claude-cli # real Engine reorderStandalone today (no other tool calls it yet) — a building block designed ahead of MyGroomer/MyCoder per the design doc. See the org README for how the shipped tools chain together.
python -m venv .venv && source .venv/bin/activate
pip install -e ../my-things-core -e ".[dev]"
pytestMIT — see LICENSE.