Repository navigation
fix: rename the remote read cache to LocalCache and confine it to stdio - #40
Merged
Merged
Conversation
The remote read cache is renamed to LocalCache, and its switch is now NOTELET_LOCAL_CACHE, a bool: true or false. Unset or empty is false. It is built only by `stdio` with a remote, and only that path reads the switch. `serve` and the database paths behave as they did before the cache existed. The value check at config load and the refusal when a database is configured are removed, so a stray value of the variable can no longer stop a command that never uses the cache. Under `stdio` with a remote, a value other than true or false still stops the start, and the message does not echo the value. notelet-core is reverted: MemoryNoteRepo has no `mirror` or `forget` again, and the port's docs read as before. The cache owns its own note store (local_cache/store.rs), which places notes exactly as the remote has them and answers list, search and dump with the same ordering, filters, paging and snippets as the memory adapter. A test runs both on the same notes and fails if they drift apart. The README, the config doc and the crate docs no longer present the cache as something reached through `serve`; they say it belongs to `stdio` with a remote. Tests pin that a pass-through read during the first fill does not wait for the fill: while the fill is held in a body fetch or in a listing, and on a cold start where only the connect is waited for. Another test pins that `stdio` starts without waiting for an unresponsive remote. Refs #38
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.
Follow-up to #39 (refs #38). PR #39 built the read cache wider than it was meant to be.
What changes
LocalCache:NOTELET_LOCAL_CACHE, a bool (true/false);local_cache;local cache:;notelet-mcp stdiowith a remote builds the cache and reads the switch. This is the local client.serveand the database paths behave as they did before feat: cache reads in remote mode behind NOTELET_REMOTE_CACHE #39, and they never read the switch.MemoryNoteRepo::mirrorandforgetare gone. The cache owns its note store (local_cache/store.rs).answers_match_the_memory_adapterchecks that list, search and dump give the same pages as the memory adapter.serve, a hook or loopback.Verify
just check: pass.just test: notelet-core 39, notelet-mcp 186 and notelet 1, all pass.just check,just testandjust test-pg-localfirst.Smoke
A release build ran
stdioagainst the dev remote withNOTELET_LOCAL_CACHE=true.initializenote_get(passed through)note_getonce fillednote_put, thennote_getinitialize/note_getnote_delete, thennote_getNotFoundat onceservewithNOTELET_LOCAL_CACHE=1An earlier measurement on #39's build gave 3.4 s for
initializeand 8.6 s for the firstnote_get. That did not reproduce here, and the code holds no wait on the fill in the pass-through path.Release note
The switch name and its values change from #39. #39 has not been released, so no released version is affected.