Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/mcp-offset-ceiling-prose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 0 additions & 5 deletions crates/nostream-mcp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ pub const MAX_ROWS_PER_PAGE: u64 = nostream_storage::DEFAULT_PAGE_ROWS;
/// best of five), against 7.936 ms for the 500-row page at offset 0 and 1.562 ms at `u64::MAX`.
/// A ceiling at this door's own page ([`MAX_ROWS_PER_PAGE`]) was rejected because at `limit: 500`
/// it leaves a caller two pages deep; 5,000 leaves eleven.
///
/// The magnitude matches [`nostream_storage::MAX_PAGE_ROWS`], the relay's largest event page —
/// the largest single page the tree already asks a backend to answer — and it is measured against
/// that clamp rather than derived from it: the invoice read has no page bound of its own, and a
/// relocation of the relay's event page must not move this door's published `maximum`.
pub const MAX_ROWS_PER_SKIP: u64 = 5_000;

/// The refusal for a credential whose document is absent, unreadable or no longer a document this
Expand Down
15 changes: 5 additions & 10 deletions docs/rewrite/decisions/0020-mcp-offset-ceiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,13 @@ Chosen on the measurement rather than on a round figure, and held here rather th
(`find_pending_invoices` takes any `limit`), and the page bound the door does state is 500. At 5,000
keys the skip costs 0.941 ms against the 7.936 ms page the store already serves, so the ceiling
bounds the walk at about a tenth of the answer it precedes. A ceiling at the page bound (500) was
rejected because at `limit: 500` it leaves a caller two pages deep; 5,000 leaves eleven. The
magnitude matches `nostream_storage::MAX_PAGE_ROWS`, the relay's largest event page — the largest
single page the tree already asks a backend to answer — and it is measured against that clamp
rather than derived from it: a change to the relay's event page is a decision about `REQ`, and it
must not move an MCP schema.
rejected because at `limit: 500` it leaves a caller two pages deep; 5,000 leaves eleven.

**Cost:** the ceiling is the door's own number, so the day the walk is re-measured it moves here and
nowhere else — at the price of a second 5,000 in the tree, where `MAX_PAGE_ROWS` already carries
one. A pending set deeper than 5,500 rows at `limit: 500` is unreachable through MCP; that reach is
what the bounded skip trades away, and nothing in the tree measures how deep a real deployment's
pending set is. Paid for: no cross-crate coupling — a relay or storage change cannot move this
door's published `maximum`, fail its snapshot, or leave its prose stale.
nowhere else. A pending set deeper than 5,500 rows at `limit: 500` is unreachable through MCP; that
reach is what the bounded skip trades away, and nothing in the tree measures how deep a real
deployment's pending set is. Paid for: no cross-crate coupling — a relay or storage change cannot
move this door's published `maximum`, fail its snapshot, or leave its prose stale.

### D3 — The refusal is the door's, with one fixed text

Expand Down
Loading