public API naming and shape decisions drift without a referenced style guide
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 86/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- rust
調査の方向性
CONTRIBUTING.md を開き、既存のコードスタイルとリポジトリのパターンのみを参照していることを確認します。既存の API を変更せずに、公開 API の命名と型の形状の基準として、公式の Rust API Guidelines への参照を追加します。完了条件は、コントリビューター向けドキュメントからガイドと関連するチェックリストに明示的にリンクされており、API の整合は引き続きスコープ外であることです。
索引モデルが issue の本文から書いたものです。
説明
Description
While looking through the crate's public API, I noticed a few inconsistencies that suggest there's no referenced style-guide baseline behind naming/type-shape decisions:
- Some plain accessors use a
get_prefix while neighboring accessors in the same files don't, which reads as inconsistent with the Rust API Guidelines' C-GETTER convention. - Identifier fields (session/task/tool-use/client id) are represented as bare
String/Arc<str>rather than distinct types, so nothing stops one id kind being passed where another is expected.
No repo doc references a style guide, so it's unclear whether this is intentional or just drift. Simplest fix: state explicitly in contributor docs that code should be idiomatic and follow the official Rust API Guidelines (https://rust-lang.github.io/api-guidelines/) - its naming (C-*) and type-safety (C-NEWTYPE) checklists already cover both examples above, so this is a documentation change, not a new process to design. Bringing existing API (like the two examples above) in line with the referenced guide is a separate, breaking-change follow-up - worth tracking on its own once the guide itself is adopted, not part of this issue.
Reproduction Steps
rg -n "pub fn get_[a-z_]+\(" crates/rmcp/src- 8 matches, all plain field/derived-value accessors inconsistent with sibling accessors in the same files.- Compare
SessionId/EventId/StreamId/task_id/tool_use_id/client_idfield types acrossmodel.rs,task_manager.rs,transport/auth.rs- all bareString/Arc<str>/type aliases, no newtype. - Checked CONTRIBUTING.md and the repo for any reference to language-specific style guide - none found. CONTRIBUTING.md only says "follow existing code style" / "follow the repository's established patterns," with no concrete convention to check against.
Expected Behavior
Contributor docs cite an explicit style-guide baseline for public API naming/shape.
Actual Behavior
No such reference exists, so it's unclear whether naming inconsistencies like the above are intentional.
Logs / Evidence
- 主要言語
- Rust
- スター
- 3.9k
- フォーク
- 645
- 平均マージ
- 4日 22時間
- マージ済み PR(30日)
- 37
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/rust-sdk のほかの issue
-
streamable-http server: a supplied Mcp-Method contradicting an initialize body is silently accepted オープンbug P1 ready for work T-transport
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/rust-sdk#1271 ·
-
bug P2 ready for work T-model
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/rust-sdk#1242 ·
-
bug P1 ready for work T-model T-service
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
modelcontextprotocol/rust-sdk#1283 · コメント 1 件 ·
-
bug P0 ready for work T-security T-transport
modelcontextprotocol/rust-sdk#1272 · 担当者 1 名 ·
-
bug P1 ready for work T-security T-transport
modelcontextprotocol/rust-sdk#1268 · リアクション 1 件 · 担当者 1 名 ·
modelcontextprotocol/rust-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
TheLarkInn/aipm#2413 ·
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
todo:ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
taikoxyz/taiko-mono#22168 · コメント 1 件 ·