fix: brand 'shared'/'global' sentinels + LLM synthesis in review_content - #11
Merged
Conversation
… support
Search:
- Add conservative English stemmer to BM25 tokenizer so plurals and
common suffixes match (errors → error, messages → message, writing → write)
Loader:
- Generate brand-prefixed IDs (shared-voice-principles, cash-app-errors)
so cross-brand files with the same filename no longer collide in the
search index
- Detect duplicate IDs after loading and emit warnings rather than
silently dropping the second unit
MCP server:
- search_knowledge: return compact listing (ID, title, enforcement,
150-char excerpt) instead of full body for every result; instruct
caller to use get_knowledge_unit(id) for full content
- get_brand_rules: return compact index instead of full compiled
skill-md dump; fixes 212KB responses
- serveMcp: add bundlePaths option so aggregator repos can merge
multiple knowledge bundles into one search index
Docs:
- Document serveMcp() API including multi-bundle usage
- Add Skills Convention section explaining skills/{name}/SKILL.md
directory structure and local install pattern
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'testing' now stems to 'test' — update expected output to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…esis to review_content - isGlobal() helper treats null/undefined/'shared'/'global' as always-include in BM25SearchAdapter.semanticSearch(), applyFilters(), and all inline brand filters in mcp-server.ts (list_knowledge_units, get_brand_rules) - review_content now calls an Anthropic LLM internally when ANTHROPIC_API_KEY is set; bodies truncated to 2000 chars each before passing to the model - ServeOptions gains anthropicApiKey and model fields; @anthropic-ai/sdk added as optional peer dep - JSDoc on RuleFilter documents the shared/global sentinel convention - Two new tests cover brand sentinel inclusion in exactMatch and semanticSearch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
delkc
marked this pull request as ready for review
April 23, 2026 14:51
nahiyankhan
approved these changes
Apr 23, 2026
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.
Why
Two bugs found in real-world testing: knowledge units tagged
brand: "shared"were silently excluded when filtering by a specific brand, andreview_contentreturned a raw ~300K character prompt wall instead of synthesized findings.What
isGlobal()helper treatingnull/undefined/"shared"/"global"as always-include; apply tosemanticSearch(),applyFilters(),list_knowledge_units, andget_brand_rulesreview_contentnow calls an Anthropic LLM internally (whenANTHROPIC_API_KEYis set), truncates bodies to 2000 chars each, and returns synthesized findingsServeOptionsgainsanthropicApiKeyandmodelfields;@anthropic-ai/sdkadded as optional peer dep with graceful fallback to raw promptRuleFilterdocuments theshared/globalsentinel conventionexactMatchandsemanticSearchRisk Assessment
Low — brand filter fix is additive (more results included, never fewer for valid queries);
review_contentLLM path only activates when an API key is present, existing raw-prompt behavior preserved as fallback.References
feat/search-improvements)Generated with Claude Code