Nagendravarma commited on
Commit
be65ddf
·
1 Parent(s): a6d1cab

Fix confidence score visibility and early retrieval node matches in dev console

Browse files
Files changed (1) hide show
  1. frontend/dev_console.html +9 -3
frontend/dev_console.html CHANGED
@@ -1178,8 +1178,9 @@ function setIntent(intentStr) {
1178
  function setConfidence(conf, reason) {
1179
  const badge = document.getElementById('conf-badge');
1180
  if (!conf) return;
1181
- badge.textContent = conf;
1182
- badge.className = `conf-badge ${conf}`;
 
1183
  badge.title = reason || '';
1184
  document.getElementById('meta-row').classList.add('visible');
1185
  }
@@ -1232,9 +1233,14 @@ function updateElapsed(ms) {
1232
  }
1233
 
1234
  function activateFromStep(step, lgNode) {
 
1235
  for (const m of STEP_MAP) {
1236
  if (m.pat.test(step)) {
1237
  m.nodes.forEach(id => {
 
 
 
 
1238
  if (id === 'graphdb' && currentIntent === 'POLICY_QUESTION') return;
1239
  setNode(id, 'active');
1240
  const fromNode = lgNode === 'retrieve' ? 'retrieve_agent' : lgNode;
@@ -1566,7 +1572,7 @@ function collectNodeData(step, node, ev) {
1566
  if (/retry|INSUFFICIENT/i.test(step)) nodeData.self_critique.final = 'RETRY';
1567
  }
1568
  // Confidence
1569
- const confMatch = step.match(/Confidence: (\w+) \(score=(\d+)(.+)\)/);
1570
  if (confMatch) {
1571
  nodeData.confidence = { level: confMatch[1], score: confMatch[2], reasons: confMatch[3].split(' | ') };
1572
  }
 
1178
  function setConfidence(conf, reason) {
1179
  const badge = document.getElementById('conf-badge');
1180
  if (!conf) return;
1181
+ const confClean = conf.trim().toUpperCase();
1182
+ badge.textContent = confClean;
1183
+ badge.className = `conf-badge ${confClean}`;
1184
  badge.title = reason || '';
1185
  document.getElementById('meta-row').classList.add('visible');
1186
  }
 
1233
  }
1234
 
1235
  function activateFromStep(step, lgNode) {
1236
+ const earlyNodes = ['user', 'fastapi', 'query_analyzer', 'query_guard', 'semantic_cache', 'memory_search'];
1237
  for (const m of STEP_MAP) {
1238
  if (m.pat.test(step)) {
1239
  m.nodes.forEach(id => {
1240
+ // Prevent early false matches from query strings during initial parsing/guard rails/cache checks
1241
+ if (earlyNodes.includes(lgNode) && ['bronze','silver','gold','vectordb','bm25','ensemble','graphdb','multiquery','priorauth','reranker','merger','synthesis','self_critique','confidence','mem_add'].includes(id)) {
1242
+ return;
1243
+ }
1244
  if (id === 'graphdb' && currentIntent === 'POLICY_QUESTION') return;
1245
  setNode(id, 'active');
1246
  const fromNode = lgNode === 'retrieve' ? 'retrieve_agent' : lgNode;
 
1572
  if (/retry|INSUFFICIENT/i.test(step)) nodeData.self_critique.final = 'RETRY';
1573
  }
1574
  // Confidence
1575
+ const confMatch = step.match(/Confidence: (\w+) \(score=(\d+)\s*[\u2013\u2014-]\s*(.+)\)/);
1576
  if (confMatch) {
1577
  nodeData.confidence = { level: confMatch[1], score: confMatch[2], reasons: confMatch[3].split(' | ') };
1578
  }