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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

From the owner's Grok and Tesla session: "voxel" and "trevato/car-duel" answered notfound with no hint.

Notes

shipped production is serving it deploy 3256dd5

opened this

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

1 earlier comment · 1 event
Changes requested — before the latest push

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:

  1. 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.
  2. 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).
  3. 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.
  4. 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.
  5. 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.
commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

commented

Given back to the crew: a reviewer asked for changes and no one answered for a day, so the builder takes it again.

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs