Repository navigation
test(mcp): pin that the offset refusal happens before any store call (#1268) - #1288
Conversation
🦋 Changeset detectedLatest commit: c552fb3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
[Low impact] This test-only PR appears safe to merge.
|
|
Thank you! |
Description
Adds regression assertions in
crates/nostream-mcp/tests/tool_payloads.rsundera_refused_criterion_never_reaches_the_storeverifying that forTOOL_INVOICES_LIST,offsetvalues greater thanMAX_ROWS_PER_SKIP(such as5001andu64::MAX) are rejected at the door before any store call is dispatched. Also pins that the boundary offset5000(MAX_ROWS_PER_SKIP) successfully passes door validation and proceeds to the store.Related Issue
Closes #1268
Motivation and Context
The issue notes that
offset: 5001andoffset: u64::MAXwere already guarded by handler validation, but were not explicitly pinned in the test suite against the store boundary seam.crates/nostream-mcp/tests/tool_payloads.rsis the only test file configured withStores::Unavailable, where all storage repositories returnStorageError::NotImplemented { module: "storage::backend::wiring" }. By testing these offset values here:MAX_ROWS_PER_SKIP(5001andu64::MAX) return an argument error (offset: <value> exceeds the per-skip maximum of 5000) without ever touching the store seam (nostorage::backend::wiringerror).MAX_ROWS_PER_SKIP(5000) passes door validation and reaches the store, failing with the store seam'sNotImplementederror.This cleanly verifies that the offset refusal happens strictly before any storage call is made.
How Has This Been Tested?
cargo test -p nostream-mcp --test tool_payloads(23/23 passed)cargo test -p nostream-mcp --test store_families(19/19 passed)cargo test -p nostream-mcp --test audit(6/6 passed)cargo test -p nostream-mcp --test tools_list(5/5 passed)cargo fmt --check --package nostream-mcpcargo clippy -p nostream-mcp --all-targets --all-features -- -D warnings-D clippy::unwrap_used -D clippy::expect_usedTypes of changes
Checklist: