service: name services for domains, methods for what they do - #1446
Conversation
search_search was not a naming rule that needed an exception, it was a service named for an action. Every other service is a noun — news, mail, places, web — so service_method reads as two different words. "search" was a verb, which left its one method nothing to be called but Search. Web search moves to the web service, next to web.Fetch, giving web_search and web_fetch. Those match the routes that already said web (/web/fetch, /web/read) and the tool name web_fetch has always carried. The /search page and the "Search" nav label stay exactly as they are: the label is what a person looks for, the service name is what a caller addresses. The search package keeps the Brave provider, the reader and the page; it just registers no service of its own. Methods returning the current set of something are now all List — news.List, blog.List, social.List, video.List, markets.List — joining stream.List, events.List and db.List. They were Headlines, Recent, Feed, Latest and Prices, five words for one idea. The derived names land on news_list, blog_list, social_list, video_list and markets_list, which are the names those tools already ship under. All 37 derived names are now service_method with no exceptions. Two tests hold it: no method may repeat its service, and no two endpoints may derive the same name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdcPjN9ndJwMGKQSRrAGPE
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d6bc325d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "video": "Video", | ||
| "blog": "Blog", | ||
| "search": "Search", | ||
| "web": "Search", |
There was a problem hiding this comment.
Migrate legacy search-only agent scopes
On upgrade, a user-defined agent persisted in user_agents.json with only the previously exposed search service retains Tools: ["search"], because there is no migration to web. Since filterServices returns every service when a nonempty allow-list matches nothing, that agent changes from search-only to access to all private services, including mail, images, events, db, and wallet, potentially exposing personal data or enabling charged actions. Translate the legacy service ID before applying the allow-list.
Useful? React with 👍 / 👎.
| // Load initializes the search package. It registers no service of its own: | ||
| // the web search capability is web.Search, and this package provides the | ||
| // provider, the reader and the /search page that sit around it. | ||
| func Load() {} |
There was a problem hiding this comment.
Keep the legacy search service reachable
Existing apps that call /apps/{slug}/sdk/service with service: "search" now receive Unknown service, because search.Load no longer registers that service and sdkServiceAllowed only accepts live registry entries. This shrinks the App SDK service set despite the explicit compatibility promise in docs/COMPATIBILITY.md; keep a deprecated forwarding registration while making web.Search canonical.
Useful? React with 👍 / 👎.
search_search was not a naming rule that needed an exception, it was a service named for an action. Every other service is a noun — news, mail, places, web — so service_method reads as two different words. "search" was a verb, which left its one method nothing to be called but Search.
Web search moves to the web service, next to web.Fetch, giving web_search and web_fetch. Those match the routes that already said web (/web/fetch, /web/read) and the tool name web_fetch has always carried. The /search page and the "Search" nav label stay exactly as they are: the label is what a person looks for, the service name is what a caller addresses. The search package keeps the Brave provider, the reader and the page; it just registers no service of its own.
Methods returning the current set of something are now all List — news.List, blog.List, social.List, video.List, markets.List — joining stream.List, events.List and db.List. They were Headlines, Recent, Feed, Latest and Prices, five words for one idea. The derived names land on news_list, blog_list, social_list, video_list and markets_list, which are the names those tools already ship under.
All 37 derived names are now service_method with no exceptions. Two tests hold it: no method may repeat its service, and no two endpoints may derive the same name.
Claude-Session: https://claude.ai/code/session_01KdcPjN9ndJwMGKQSRrAGPE