Skip to content

test(mcp): pin that the offset refusal happens before any store call (#1268) - #1288

Merged
cameri merged 1 commit into
rewrite/mainfrom
fix/1268-mcp-offset-refusal-before-store
Nov 29, 2026
Merged

cameri merged 1 commit into
rewrite/mainfrom
fix/1268-mcp-offset-refusal-before-store

Conversation

@avantikonde

Copy link
Copy Markdown
Collaborator

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

  • 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:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c552fb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a6fdcfe0-b34d-421d-9109-a5cf1f826e93

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · This test-only PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only PR appears safe to merge.

Summary

Adds regression checks for invoice offsets in a_refused_criterion_never_reaches_the_store.

  • Invoice offset tests now distinguish refusals from store calls.

Reviews (1) · Last reviewed commit: "test(mcp): pin that the offset refusal h..." · Reviewed by Greptile

@cameri
cameri merged commit 64916a6 into rewrite/main Nov 29, 2026
19 checks passed
@cameri
cameri deleted the fix/1268-mcp-offset-refusal-before-store branch November 29, 2026 22:29
@cameri

cameri commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants