Repository navigation
Improve MCP validation efficiency and annotate public APIs with nodiscard - #3024
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
🤖 Augment PR SummarySummary: Improves MCP validation efficiency and makes ignored public API results visible.
🤖 Was this summary useful? React with 👍 or 👎 |
aa5d198 to
ef8c35d
Compare
|
augment review |
ef8c35d to
c704323
Compare
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
aea02e4 to
205435d
Compare
|
augment review |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
205435d to
d10e9ce
Compare
|
augment review |
…card - Replace ad-hoc array of strings validation loop with is_array_of_strings() in validation.h. - Avoid unnecessary string allocations when dispatching message and content types. - Annotate public MCP functions across protocol, headers, results, capabilities, error, and logging with [[nodiscard]]. - Update test helpers to cast discarded results to void. Signed-off-by: HarshPopat23 <musichk61@gmail.com>
d10e9ce to
8f7d7f2
Compare
|
augment review |
| try { | ||
| sourcemeta::core::mcp_make_resource_link( | ||
| sourcemeta::core::MCPProtocolVersion::V_2025_03_26, "file:///a", "a"); | ||
| static_cast<void>(sourcemeta::core::mcp_make_resource_link( |
There was a problem hiding this comment.
Please use [[maybe_unused]] instead
| #define EXPECT_MCP_REJECTS(expression, expected_message) \ | ||
| try { \ | ||
| expression; \ | ||
| static_cast<void>(expression); \ |
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
| [[maybe_unused]] const auto &sourcemeta_test_result{ \ | ||
| sourcemeta_test_expression()}; \ | ||
| } \ | ||
| }([&]() -> decltype(auto) { return (expression); }); \ |
There was a problem hiding this comment.
This looks very weird. I don't think you need this? Can you check? i.e. can't you provide the actual return type in the lambda declaration?
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
|
Thanks @jviotti |
Summary
Combines MCP validation performance and API safety improvements:
Testing