Repository navigation
fix(mcp): exclude refresh_metadata.json from searchable KB - #351
Conversation
update_kb.py/expand_kb.py write refresh_metadata.json into the knowledge_base directory, but it was not in _EXCLUDED_KB_FILES. Its run-specific string leaves drifted the docs_kb content hash from the shipped index on every KB Auto-Update workflow run, failing the shipped-index tests and forcing slow runtime re-encoding. Add it to the exclusion set and add a regression test covering all three generator sidecars.
There was a problem hiding this comment.
Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
|
No actionable findings. The new exclusion correctly applies to both runtime searches and shipped-index hashing, and the regression test covers all three generator sidecars. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by step-3.7-flash · Input: 44.4K · Output: 3.1K · Cached: 360.8K |
Qodana for JS238 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
|
/oc review |
|
No actionable findings. The fix is minimal and correctly targeted: adding Summary index:
|
|
/oc fix failing CI Python test |
|
All verified. Working tree is clean (fix already in the PR); no code changes were needed. Summary — The PR already contains the complete fix; I verified it end-to-end since no review threads on this PR were actionable (coderabbit/opencode ×2/kilo all reported no findings; sourcery hit its rate limit). Verified
Threads resolved: none — no review threads existed on the PR. Remaining risk: low. The fix is minimal, single-filter, regression-tested, and the full suite passes locally. |



Problem
KB Auto-Update workflow runs #2 (Aug 10) and #3 (Aug 17) failed in the Python MCP tests step:
tests/test_index_store.py::test_docs_shipped_index_loadstests/test_index_store.py::test_get_or_build_uses_shipped_without_encodetests/test_build_kb_index.py::test_skips_build_when_indexes_up_to_datetests/test_tools.py::test_search_olive_documentation*Failed runs: 31362669221, 32001066709
Root cause
update_kb.py/expand_kb.pywriterefresh_metadata.jsonintoolive_mcp_server/knowledge_base/as a provenance sidecar. Unlike the other two generator outputs (update_report.json,candidate_quirks.json), it was missing from_EXCLUDED_KB_FILESindocs_search.py, so its run-specific string leaves (timestamps, fingerprints, changed-file lists) were folded into the searchable KB.Evidence from run #3:
refresh_metadata.jsonartifact flattens to exactly 14 string leaves; CI logged 4725 snippets during the attempted rebuild (4711 + 14)Run #1 (Aug 3) passed only because the shipped-index tests did not exist yet at that SHA.
Fix
refresh_metadata.jsonto_EXCLUDED_KB_FILESso generator sidecars never affect the KB content hashtest_generator_sidecars_excluded_from_kb_hashcovering all three sidecarsVerification
test_docs_search_semantic.py+test_index_store.py+test_build_kb_index.pypasstest_tools.pypass (teardown-error suite)refresh_metadata.jsonartifact into the KB dir and re-ran the shipped-index suites: all pass