Public: anyone can read this; the crew can change it.
Repository names: a bare name finds yours, a miss says why and suggests (#16462, #16465) #16472
Check · Review · Land · Live done — Landed and live in production.
From the owner's Grok and Tesla session: "voxel" and "trevato/car-duel" answered notfound with no hint.
shipped production is serving it deploy 3256dd5
1 earlier comment · 1 event
Security reads clean: guesses and the bare-name path are filtered through canRead, and the miss sentence is identical for a hidden and a missing repository. Changes needed, all in one round:
- FIRST: a bare name must find YOURS (the pull's own title). When the caller owns one of the readable matches, that one wins. Today a bare 'garden' for ben, who owns ben/garden, is answered 'names more than one', and the test pins that. Return the caller's own repository first; use the ambiguity message only when the caller owns none, or owns several.
- Both doors: this resolves names only in the MCP tool (repoArg). A person using the terminal (src/tui/) or the page's repository lookup who says a bare name or a near name still gets the old miss. Either share readableNamed in those doors or say in the pull why they already use it. Add the how-to as docs/features/<name>.md (not README.md).
- readableNamed fetches rows with LIMIT 200 before the canRead filter, so on a name shared by many owners, or an owner with over 200 repositories, readable matches can be cut and the answer becomes wrong. Filter in SQL, or page until limit readable rows are found.
- Tests: add a case for the caller's own repository winning (item 1), a near miss under the right owner when the owner has a private lookalike, and one for the '@owner/name' and whitespace trimming, which has no test. The mcp-pins test was edited to a different miss name to fit the new behaviour; that is acceptable, but say so in the pull.
- Run bun scripts/gate.ts --fix and tsc; the long lines in readableNamed (the close filter, the bad(...) template) are over the repository's wrap.
Both earlier asks are met. (1) A bare name now returns the caller's own repository first, and only reports ambiguity otherwise; the test covers ben/garden winning over trevato/garden. (2) reposByNameOrOwner is paged (200 rows, up to 4,000), and canRead runs on matches before the next page, so unreadable rows no longer crowd out readable ones. Visibility is filtered before ranking, so a miss reads the same whether a private repository exists or not, and the test pins hidden == missing. The signed-out path stays one bounded read, pinned at 2 queries. The how-to is in docs/features/repo-names.md, not the README. Non-blocking: the 4,000-row cap on the name scan is silent. That is fine for now, but name it in the doc if it ever bites.
From the owner's Grok and Tesla session: "voxel" and "trevato/car-duel" answered not_found with no hint. Every tool's repo argument now resolves a bare name to the one repository by that name the caller can read (or names the candidates), and a miss says "it does not exist, or it is private and not shared with you" plus up to three "Did you mean owner/name?" from repositories the caller can read. Hidden and missing answer alike, so the private-404 rule holds.
🤖 Generated with Claude Code