Repository navigation
Keep every registry row when curated servers lead a first page - #173
Conversation
lead_with_curated put the curated servers matching a query at the head of page one, then cut the page back to page_size. Page two continues from the registry's own cursor, so each registry row pushed off page one appeared on no page at all: a matching server was silently missing from the results. A registry page (live or cached) is no longer cut. It may run longer by the curated servers it adds, and every registry row still appears exactly once across pages. The local fallback served when the registry is down is one bounded page with nothing after it, so it keeps its page-size cap, as before.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): Keep every registry row when curated servers lead a first page. Pull request purpose (title): "Keep every registry row when curated servers lead a first page." This pull request fixes a silent data-loss bug in the official-registry search path: `lead_with_curated` prepended curated servers to page one and then truncated the page back to `page_size`, so registry rows pushed off page one appeared on no page at all, because page two continues from the registry's own cursor. The change makes the truncation cap optional: a live or cached registry page is no longer cut and may run longer by the curated rows it adds, while the local fallback — a single bounded page with nothing after it — keeps its page-size cap. The latest-push-delta evidence is unavailable, so no push delta is described and the diff below is the whole pull-request diff. Review snapshot
Completeness: Complete What changed`lead_with_curated` now takes `cap: Option<usize>` in place of `page_size: u32` and only truncates the merged page when a cap is supplied. The caller in `McpOfficialRegistry`'s search path supplies a cap only when `found.freshness == RegistryFreshness::LocalFallback`, computed as `usize::try_from(page_size.max(1)).unwrap_or(usize::MAX)`; other freshness values yield `None`, so live and cached registry pages keep every registry row alongside the curated lead. The rustdoc was rewritten to explain that a registry page is followed by its cursor while only a page with nothing after it is cut. Tests were updated to the new signature and extended with a two-page loopback-registry test and a cap test; the description also records a red control in which cutting page one back to 2 rows drops `@acme/slack-b`. Features
Tests
FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["lead_with_curated<br/>changed"]:::changed
n1["served<br/>changed"]:::changed
n2["a_blank_query_leaves_the_page_alone<br/>changed"]:::changed
n3["a_curated_lead_stays_within_the_page_size<br/>changed"]:::changed
n4["...age_moves_to_the_head_as_the_registry_row<br/>changed"]:::changed
n5["summaries"]:::impacted
n6["...ds_a_page_row_matching_on_its_description"]:::impacted
n7["...d_as_a_page_row_and_a_detail_appears_once"]:::impacted
n8["search_live"]:::impacted
n9["CursorCache"]:::impacted
n1 -->|uses| n9
n2 -->|calls| n0
n2 -->|tests| n0
n2 -->|calls| n5
n2 -->|tests| n5
n3 -->|calls| n0
n3 -->|tests| n0
n3 -->|calls| n5
n3 -->|tests| n5
n4 -->|calls| n0
n4 -->|tests| n0
n4 -->|calls| n5
n4 -->|tests| n5
n8 -->|calls| n1
n8 -->|uses| n9
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Summary
lead_with_curatedput the curated servers matching a query at the head of page one, then cut the page back topage_size. Page two continues from the registry's own cursor, so each registry row pushed off page one appeared on no page at all: a matching server silently went missing from the results.A registry page (live or cached) is no longer cut. It may run longer by the curated servers it adds, and every registry row appears exactly once across pages. The local fallback served when the registry is down is one bounded page with nothing after it, so it keeps its page-size cap, as before.
Related issue
None filed. Found by reading the official-registry search path.
API or behavior changes
On a live first page with a query matching curated servers, the page can hold more than
page_sizerows: the registry's rows plus the curated ones it added. No contract change.Validation
On our Linux CI runner, at e0784e8:
cargo fmt --all -- --check: clean.cargo clippy --all-targets --all-features -- -D warnings: 0 errors on this branch and on main.cargo build --all-targets --all-features: ok.cargo test -p tinymcp registry::sources::official: 150 passed, 0 failed.cargo test --workspace: no failures unique to this branch. The same flaky boot and directories tests fail on main too (main: 5 failed; this branch: 4).every_registry_row_appears_exactly_once_across_pages_when_a_curated_server_leads, with@acme/slack-bmissing.Tests
every_registry_row_appears_exactly_once_across_pages_when_a_curated_server_leadsuses a loopback registry with two pages of two rows. Across pages 1 and 2 every registry row appears once, and the curated server once.a_curated_lead_keeps_every_registry_row_on_the_pagereplaces the old truncation test.a_page_with_nothing_after_it_is_cut_back_to_its_capchecks the cut is kept for the fallback. The existinga_local_match_is_capped_at_the_page_sizestill passes.Documentation
The rustdoc on
lead_with_curated.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description