// Scoring constants for Claude Code conversation relevance
// These weights are tuned based on what makes conversations most useful for Claude
// Core scoring weights
export const EXACT_MATCH_SCORE = 10; // Exact tech term match (e.g., "react" query matches "React")
export const SUPPORTING_TERM_SCORE = 3; // 5+ char supporting terms
export const WORD_MATCH_SCORE = 2; // General word matches
export const EXACT_PHRASE_BONUS = 5; // Full query phrase appears
export const MAJORITY_MATCH_BONUS = 4; // 60%+ of query words match
// Context scoring weights
export const TOOL_USAGE_SCORE = 5; // Message uses tools
export const FILE_REFERENCE_SCORE = 3; // Contains file paths
export const PROJECT_MATCH_SCORE = 5; // Matches project context
// Core tech patterns - specific frameworks/tools that MUST match for relevance
// These are "must-match" terms: if query contains them, content MUST also contain them
export const CORE_TECH_PATTERN =
/^(webpack|docker|react|vue|angular|node|npm|yarn|typescript|python|rust|go|java|kubernetes|aws|gcp|azure|postgres|mysql|redis|mongodb|graphql|rest|grpc|oauth|jwt|git|github|gitlab|jenkins|nginx|apache|eslint|prettier|babel|vite|rollup|esbuild|jest|mocha|cypress|playwright|nextjs|nuxt|svelte|tailwind|sass|less|vitest|pnpm|turborepo|prisma|drizzle|sequelize|sqlite|leveldb|indexeddb)$/i;
// Generic terms that should NOT become core terms even if 5+ chars
// These appear in many contexts and don't indicate specific technical relevance
export const GENERIC_TERMS = new Set([
// Action words
'config',
'configuration',
'setup',
'install',
'build',
'deploy',
'test',
'run',
'start',
'create',
'update',
'fix',
'add',
'remove',
'change',
'optimize',
'optimization',
'improve',
'use',
'using',
'with',
'for',
'the',
'and',
'make',
'write',
'read',
'delete',
'check',
// Testing-related words (appear in many contexts: A/B testing, user testing, etc.)
'testing',
'tests',
'mocks',
'mocking',
'mock',
'stubs',
'stubbing',
'specs',
'coverage',
// Design/architecture terms (appear across many domains)
'design',
'designs',
'designing',
'responsive',
'architecture',
'pattern',
'patterns',
// Performance/optimization terms
'caching',
'cache',
'rendering',
'render',
'bundle',
'bundling',
'performance',
// Process/strategy terms
'strategy',
'strategies',
'approach',
'implementation',
'solution',
'solutions',
'feature',
'features',
'system',
'systems',
'process',
'processing',
'handler',
'handling',
'manager',
'management',
// Common nouns that appear in many contexts
'files',
'file',
'folder',
'directory',
'path',
'code',
'data',
'error',
'errors',
'function',
'functions',
'class',
'classes',
'method',
'methods',
'variable',
'variables',
'component',
'components',
'module',
'modules',
'package',
'packages',
'library',
'libraries',
// Format/display words
'format',
'formatting',
'style',
'styles',
'layout',
'display',
'show',
'hide',
'visible',
'rules',
'rule',
'options',
'option',
'settings',
'setting',
'params',
'parameters',
// Generic technical words
'server',
'client',
'request',
'response',
'async',
'await',
'promise',
'callback',
'import',
'export',
'require',
'include',
'define',
'declare',
'return',
'output',
'input',
// Database/schema generic terms (appear in many contexts)
'database',
'schema',
'schemas',
'models',
'model',
'table',
'tables',
'query',
'queries',
'migration',
'migrations',
'index',
'indexes',
'field',
'fields',
'column',
'columns',
// Deployment/infra generic terms
'deployment',
'container',
'containers',
'service',
'services',
'cluster',
'clusters',
'instance',
'instances',
'environment',
'environments',
'manifest',
'resource',
'resources',
// Common programming terms
'interface',
'interfaces',
'types',
'typing',
'object',
'objects',
'array',
'arrays',
'string',
'strings',
'number',
'numbers',
'boolean',
'value',
'values',
'property',
'properties',
]);