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..515afffdc 100644 --- a/docs/rewrite/decisions/0020-mcp-offset-ceiling.md +++ b/docs/rewrite/decisions/0020-mcp-offset-ceiling.md @@ -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