mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-13 16:13:03 +08:00
fix: tune machine learning workflow routing
This commit is contained in:
committed by
Affaan Mustafa
parent
240d52d27f
commit
ab6e998383
@@ -11,6 +11,21 @@ const DEFAULT_TARGET = 'claude';
|
||||
const DEFAULT_LIMIT = 5;
|
||||
const MAX_LIMIT = 20;
|
||||
const SCHEMA_VERSION = 'ecc.consult.v1';
|
||||
const FUZZY_EXCLUDED_TOKENS = new Set(['review']);
|
||||
const MACHINE_LEARNING_CONTEXT_TOKENS = new Set([
|
||||
'data-science',
|
||||
'evals',
|
||||
'evaluation',
|
||||
'inference',
|
||||
'ml',
|
||||
'mle',
|
||||
'mlops',
|
||||
'model',
|
||||
'models',
|
||||
'pytorch',
|
||||
'serving',
|
||||
'training',
|
||||
]);
|
||||
|
||||
const STOP_WORDS = new Set([
|
||||
'a',
|
||||
@@ -74,6 +89,7 @@ const COMPONENT_ALIASES = Object.freeze({
|
||||
'mlops',
|
||||
'model',
|
||||
'models',
|
||||
'pytorch',
|
||||
'training',
|
||||
'inference',
|
||||
'serving',
|
||||
@@ -252,6 +268,7 @@ function scoreAgainstQuery(queryTokens, corpusTokens, options = {}) {
|
||||
|
||||
if (
|
||||
token.length >= 4
|
||||
&& !FUZZY_EXCLUDED_TOKENS.has(token)
|
||||
&& [...corpus].some(corpusToken => (
|
||||
corpusToken.length >= 4
|
||||
&& (corpusToken.includes(token) || token.includes(corpusToken))
|
||||
@@ -272,6 +289,7 @@ function scoreAgainstQuery(queryTokens, corpusTokens, options = {}) {
|
||||
function preferredComponentBonus(component, queryTokens) {
|
||||
let bonus = 0;
|
||||
const suffix = component.id.split(':')[1];
|
||||
const hasMachineLearningContext = queryTokens.some(token => MACHINE_LEARNING_CONTEXT_TOKENS.has(token));
|
||||
|
||||
if (queryTokens[0] === suffix) {
|
||||
bonus += 5;
|
||||
@@ -281,7 +299,17 @@ function preferredComponentBonus(component, queryTokens) {
|
||||
bonus += 3;
|
||||
}
|
||||
|
||||
if (component.id === 'capability:security' && queryTokens.some(token => ['audit', 'review', 'security'].includes(token))) {
|
||||
if (component.id === 'agent:mle-reviewer' && hasMachineLearningContext) {
|
||||
bonus += 2;
|
||||
}
|
||||
|
||||
if (
|
||||
component.id === 'capability:security'
|
||||
&& (
|
||||
queryTokens.some(token => ['audit', 'security', 'threat', 'vulnerability'].includes(token))
|
||||
|| (!hasMachineLearningContext && queryTokens.includes('review'))
|
||||
)
|
||||
) {
|
||||
bonus += 4;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user