Repository navigation
Commit 64916a6
authored
## Description
Adds regression assertions in
`crates/nostream-mcp/tests/tool_payloads.rs` under
`a_refused_criterion_never_reaches_the_store` verifying that for
`TOOL_INVOICES_LIST`, `offset` values greater than `MAX_ROWS_PER_SKIP`
(such as `5001` and `u64::MAX`) are rejected at the door before any
store call is dispatched. Also pins that the boundary offset `5000`
(`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: 5001` and `offset: u64::MAX` were 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.rs` is the only test file
configured with `Stores::Unavailable`, where all storage repositories
return `StorageError::NotImplemented { module:
"storage::backend::wiring" }`. By testing these offset values here:
- Values above `MAX_ROWS_PER_SKIP` (`5001` and `u64::MAX`) return an
argument error (`offset: <value> exceeds the per-skip maximum of 5000`)
without ever touching the store seam (no `storage::backend::wiring`
error).
- Boundary value `MAX_ROWS_PER_SKIP` (`5000`) passes door validation and
reaches the store, failing with the store seam's `NotImplemented` error.
This cleanly verifies that the offset refusal happens strictly before
any storage call is made.
## How Has This Been Tested?
- Ran the modified test suite:
- `cargo test -p nostream-mcp --test tool_payloads` (23/23 passed)
- Ran all other MCP test suites:
- `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)
- Ran formatting and linter checks:
- `cargo fmt --check --package nostream-mcp`
- `cargo clippy -p nostream-mcp --all-targets --all-features -- -D
warnings`
- Strict workspace clippy checks with `-D clippy::unwrap_used -D
clippy::expect_used`
## Types of changes
- [x] Non-functional change (docs, style, minor refactor)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
- [x] I have added tests to cover my code changes.
- [x] I added a changeset, or this is docs-only and I added an empty
changeset.
- [x] All new and existing tests passed.
2 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
523 | 526 | | |
524 | 527 | | |
525 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
526 | 558 | | |
527 | 559 | | |
528 | 560 | | |
| |||
0 commit comments