From 3c801bce6edad04520eed49639e65b71d834b2f5 Mon Sep 17 00:00:00 2001 From: Abir Maity Date: Sun, 29 Nov 2026 18:01:22 +0530 Subject: [PATCH 1/2] docs(mcp): drop unenforced MAX_PAGE_ROWS comparison Fixes #1266 (cherry picked from commit 0e0b5eec7f6a1cd065313a4b538d492a529dcabe) --- .changeset/mcp-offset-ceiling-prose.md | 2 ++ crates/nostream-mcp/src/server.rs | 5 ----- docs/rewrite/decisions/0020-mcp-offset-ceiling.md | 9 ++------- 3 files changed, 4 insertions(+), 12 deletions(-) create mode 100644 .changeset/mcp-offset-ceiling-prose.md diff --git a/.changeset/mcp-offset-ceiling-prose.md b/.changeset/mcp-offset-ceiling-prose.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/mcp-offset-ceiling-prose.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/crates/nostream-mcp/src/server.rs b/crates/nostream-mcp/src/server.rs index ec9728572..a92f8e52e 100644 --- a/crates/nostream-mcp/src/server.rs +++ b/crates/nostream-mcp/src/server.rs @@ -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 diff --git a/docs/rewrite/decisions/0020-mcp-offset-ceiling.md b/docs/rewrite/decisions/0020-mcp-offset-ceiling.md index 2f1b1987e..054ab521f 100644 --- a/docs/rewrite/decisions/0020-mcp-offset-ceiling.md +++ b/docs/rewrite/decisions/0020-mcp-offset-ceiling.md @@ -54,15 +54,10 @@ 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 +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. From e07aa933c01cccf5fe0c0c68a06d6c3855dca7fc Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Sun, 29 Nov 2026 07:59:29 -0500 Subject: [PATCH 2/2] style(mcp): rewrap ADR 0020's D2 cost paragraph to the file's 100 columns --- docs/rewrite/decisions/0020-mcp-offset-ceiling.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/rewrite/decisions/0020-mcp-offset-ceiling.md b/docs/rewrite/decisions/0020-mcp-offset-ceiling.md index 054ab521f..515afffdc 100644 --- a/docs/rewrite/decisions/0020-mcp-offset-ceiling.md +++ b/docs/rewrite/decisions/0020-mcp-offset-ceiling.md @@ -57,10 +57,10 @@ bounds the walk at about a tenth of the answer it precedes. A ceiling at the pag 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. 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