feat(mcp): background incremental registry sync - #5256
Open
bistack wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks @bistack for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
bistack
force-pushed
the
feature/mcp-discovery
branch
7 times, most recently
from
August 7, 2026 05:43
abf2152 to
233557e
Compare
registry_sync now returns instantly from the local snapshot and refreshes it in the background: incremental via updated_since, with a full pagination only when the snapshot is missing or older than a month, and atomic cache replacement.
bistack
force-pushed
the
feature/mcp-discovery
branch
from
August 7, 2026 06:04
233557e to
1c67aa3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registry_syncno longer blocks on (or even performs) a full registry download on every call:tokio::spawn, guarded by a process-wide mutex so at most one sync runs at a time.updated_sincefilter (1-3 pages vs 46+ for the full listing), with a monthly full pagination as reconciliation when the snapshot is missing or older thanFULL_RESYNC_INTERVAL_SECS.write_atomic), so a failed sync never corrupts or loses the previous snapshot.Source-structure budget
scripts/source-structure-budget.jsonbumpsmax_total_owned_rust_lines673375 -> 673820 (+445 net lines; +507/-62 inmcp_registry.rs). Composition: ~160 lines of production code (background sync viatokio::spawn,updated_sinceincremental refresh with in-memory merge, atomic cache replace, the cache-path injection hook), ~305 lines of tests (sync_strategy / merge_incremental_entries / catalog coverage, fixture updates, the cross-platform cache-path test hook), ~45 lines of comments. No new modules; growth is in the existingmcp_registry.rsmodule.Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-features --locked(warning-free under the CI allow list)cargo test -p codewhale-tui --locked mcp_registry— all 21 tests pass on macOS/Linux, including the previously Windows-failingfresh_cache_serves_catalog_without_network(fixed via an explicit cache-path injection, becausedirs::home_dir()resolves the OS profile directory on Windows through SHGetKnownFolderPath, which no environment variable can redirect).CI status (as of the latest run)
headless_bash_success_and_failure_are_distinct_bounded_exact_evidence(crates/tui/tests/adaptive_evidence_acceptance.rs), an unrelated pre-existing Windows issue:write_session_artifactfails on Windows, the truncation footer falls back to the legacy path, and the assertionreceipt.contains("/artifacts/")fails. This test was previously masked by--fail-fast(the oldfresh_cachefailure stopped the run before integration tests) and is not touched by this PR. Allmcp_registrytests pass on Windows.cargo testitself passes; the job stalls on the "Run isolated Skills Manager PTY acceptance" step, a pre-existing PTY acceptance hang documented in CONTRIBUTING (input-starvation issue), unrelated to this PR.Checklist
mcp_registry)No-Issue: MCP registry sync improvement; no tracked issue yet