feat(server): extend _meta.vouch_hot_memory to all read-side kb.* tools#261
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
a23eae1 to
01105b4
Compare
|
Fix the conflict |
cb337c9 to
fae787d
Compare
|
@plind-junior Fixed conflicts |
|
@plind-junior please check |
|
this does what #225 asked, and does it carefully — blocking: the second CHANGELOG.md hunk inserts the feature's "added" bullet under blocking: blocking: the repo's own jsonl clients still read the flat shape and none of them run in ci. non-blocking: verdict: request changes — the feature and tests are solid and fully answer #225, but the misplaced changelog entry, the impossible |
rebasing feat/hot-memory-universal-coverage onto main's kb.list_pages (frontmatter filters, vouchdev#234-adjacent) collided with this branch's own kb.list_pages (hot-memory envelope, vouchdev#225) — both touched the same function. the conflict resolution keeps both: filter_pages() runs first, then the result wraps in {"items": [...], "_meta": {...}} like every other kb.list_* method. test_page_filters.py predates that envelope and asserted on the bare list; update the two JSONL/MCP assertions to read result["items"].
…lugin.json _load_host_compat (vouchdev#237) has been reading openclaw.compat from openclaw.plugin.json since it shipped in 1.2.0, so kb.capabilities.host_compat has always reported {} — that manifest never carries a top-level "openclaw" key (test_manifest_carries_no_dead_dialect_fields enforces this; it's a dead field from the pre-2026.6 dialect). openclaw.compat.pluginApi has only ever lived in package.json, alongside openclaw.extensions. repoints _load_host_compat (renamed _PLUGIN_MANIFEST_PATH -> _HOST_COMPAT_MANIFEST_PATH for clarity) and the mirroring test at package.json. fixes test_capabilities_host_compat_matches_openclaw_manifest and test_capabilities_host_compat_present_and_nonempty, both failing before this change.
test_hot_memory_universal_coverage requires every kb.* method to be in HOT_MEMORY_COVERED or HOT_MEMORY_EXCLUDED. main grew nine methods this branch didn't know about: kb.activity, kb.clear_claims, kb.experts, kb.get_skill, kb.list_sessions, kb.list_skills, kb.propose_delete, kb.session_transcript, kb.summarize_session. classified by shape: kb.activity joins kb.digest/kb.stats as an aggregate; kb.experts joins kb.detect_themes as self-contained ranked analysis; kb.list_skills/kb.get_skill/kb.list_sessions/ kb.session_transcript aren't claim/artifact reads at all; kb.propose_delete and kb.summarize_session are write paths behind the review gate; kb.clear_claims mutates durable state directly.
…rsion, in-repo jsonl clients three blocking review comments on vouchdev#225's hot-memory work: - the feature's CHANGELOG "Added" bullet had landed under the immutable [1.0.0] — 2026-06-26 section instead of [Unreleased] (a rebase artifact: the hunk's context still matched after [1.0.0] got cut, so it merged without conflict in the wrong place). moved it to [Unreleased] -> Added. - LIST_ENVELOPE_DEPRECATION.remove_in said "0.3.0" while the repo is on 1.3.0, which reads as already-removed. vouchdev#225 asked for one release cycle, so "1.4.0". - the repo's own jsonl clients still read the pre-envelope flat-list shape and none of them run in CI: adapters/jsonl-shell/example-pipeline.sh, adapters/jsonl-shell/README.md (two spots), examples/browse-and-read/ run.sh's first_field() helper, and — found while grepping for other .result[] consumers per the review — two assertions in examples/review-gate-dry-run-preview/run.sh and the pending-count tracking in examples/sessions-and-crystallize/run.sh. all now read result.items. verified by running each script end to end (jq-based ones use jq, which isn't installed here, but the three python-parsed scripts ran and passed).
9cdeae2 to
191dd4d
Compare
|
@plind-junior updated |
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]