feat(server): extend _meta.vouch_hot_memory to all read-side kb.* tools#261
Open
jsdevninja wants to merge 2 commits into
Open
feat(server): extend _meta.vouch_hot_memory to all read-side kb.* tools#261jsdevninja wants to merge 2 commits into
jsdevninja wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bf18f7c to
4e914a1
Compare
4e914a1 to
a23eae1
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.
What changed
Every primary read-side
kb.*tool now attaches_meta.vouch_hot_memory— a TTL-cached sidebar of recently approved claims — when the KB has recent activity. Coverage extends fromkb.search/kb.context/kb.read_claimtokb.read_page,kb.read_entity,kb.read_relation, and allkb.list_*methods.kb.list_*responses are wrapped in{"items": [...], "_meta": {...}}with a deprecation note for clients that expected a flat list.kb.capabilitiesadvertises the contract underhot_memory.Closes #225
Why
Gbrain attaches its hot-memory sidebar to every MCP read response; vouch only covered three tools after the initial hot-memory work. Agents calling
kb.read_entityorkb.list_pendinghad to make a second round-trip to learn what just changed. This is the cheap follow-up that fully closes that gap.What might break
Breaking (JSONL / MCP):
kb.list_pages,kb.list_claims,kb.list_entities,kb.list_relations,kb.list_sources, andkb.list_pendingno longer return a bare list. They return a dict envelope with anitemskey._meta.deprecationdocuments the migration (result.itemsinstead ofresult). No on-disk.vouch/layout changes; no new write paths; the review gate is untouched.Non-breaking: Dict-returning read tools (
kb.read_*,kb.search,kb.context) keep their existing top-level shape;_meta.vouch_hot_memoryis additive and omitted when the sidebar would be empty.VEP
Not required — read-side response decoration only; no object model, on-disk layout, bundle format, or audit-log shape changes.
Tests
make checkpasses locally (lint + mypy + ruff)tests/test_hot_memory.py, includingtest_hot_memory_universal_coverage)CHANGELOG.mdupdated under## [Unreleased]