| @@ -209,18 +209,8 @@ | ||
| 209 | 209 | // Update action matches |
| 210 | 210 | this.updateActionMatches(testingData.action_matches || []); |
| 211 | 211 | |
| 212 | 212 | // Log summary |
| 213 | - // 58f8b4: URL-guard outcome — surface silent stripping. | |
| 214 | - if (testingData.url_validation) { | |
| 215 | - var uv = testingData.url_validation; | |
| 216 | - if (uv.removed_count > 0) { | |
| 217 | - this.log('URL guard stripped ' + uv.removed_count + ' unapproved link' + (uv.removed_count !== 1 ? 's' : '') + ': ' + (uv.removed_urls || []).join(', ')); | |
| 218 | - } else if (uv.checked > 0) { | |
| 219 | - this.log('URL guard: all ' + uv.checked + ' link' + (uv.checked !== 1 ? 's' : '') + ' in the answer approved (' + (uv.strict ? 'strict' : 'lenient') + ' mode)'); | |
| 220 | - } | |
| 221 | - } | |
| 222 | - | |
| 223 | 213 | if (testingData.knowledge_base_type) { |
| 224 | 214 | this.log('Knowledge Base: ' + testingData.knowledge_base_type); |
| 225 | 215 | } |
| 226 | 216 | if (testingData.similarity_threshold) { |
| @@ -328,12 +318,8 @@ | ||
| 328 | 318 | el.html('<div class="mxch-testing-no-data">No similarity data available</div>'); |
| 329 | 319 | return; |
| 330 | 320 | } |
| 331 | 321 | |
| 332 | - // Hybrid keyword boost (38ffa1): rows carry matched_via + fused_rank | |
| 333 | - // when hybrid retrieval was on for this test message. | |
| 334 | - var hybridOn = topMatches.some(function(m) { return m.matched_via; }); | |
| 335 | - | |
| 336 | 322 | // Group matches by source URL |
| 337 | 323 | var groupedByUrl = {}; |
| 338 | 324 | topMatches.forEach(function(match) { |
| 339 | 325 | var url = match.source_display || 'Unknown'; |
| @@ -344,11 +330,9 @@ | ||
| 344 | 330 | bestScore: 0, |
| 345 | 331 | usedForContext: false, |
| 346 | 332 | totalChunks: match.total_chunks || 1, |
| 347 | 333 | matchedChunks: [], |
| 348 | - isChunked: match.is_chunk || false, | |
| 349 | - bestFusedRank: Infinity, | |
| 350 | - viaSet: {} | |
| 334 | + isChunked: match.is_chunk || false | |
| 351 | 335 | }; |
| 352 | 336 | } |
| 353 | 337 | |
| 354 | 338 | if (match.similarity_percentage > groupedByUrl[url].bestScore) { |
| @@ -358,15 +342,8 @@ | ||
| 358 | 342 | if (match.used_for_context) { |
| 359 | 343 | groupedByUrl[url].usedForContext = true; |
| 360 | 344 | } |
| 361 | 345 | |
| 362 | - if (match.fused_rank && match.fused_rank < groupedByUrl[url].bestFusedRank) { | |
| 363 | - groupedByUrl[url].bestFusedRank = match.fused_rank; | |
| 364 | - } | |
| 365 | - if (match.matched_via) { | |
| 366 | - groupedByUrl[url].viaSet[match.matched_via] = true; | |
| 367 | - } | |
| 368 | - | |
| 369 | 346 | groupedByUrl[url].matchedChunks.push({ |
| 370 | 347 | chunkIndex: match.chunk_index, |
| 371 | 348 | score: match.similarity_percentage, |
| 372 | 349 | usedForContext: match.used_for_context, |
| @@ -373,14 +350,9 @@ | ||
| 373 | 350 | aboveThreshold: match.above_threshold |
| 374 | 351 | }); |
| 375 | 352 | }); |
| 376 | 353 | |
| 377 | - var urlGroups = Object.values(groupedByUrl).sort(function(a, b) { | |
| 378 | - if (hybridOn && a.bestFusedRank !== b.bestFusedRank) { | |
| 379 | - return a.bestFusedRank - b.bestFusedRank; | |
| 380 | - } | |
| 381 | - return b.bestScore - a.bestScore; | |
| 382 | - }); | |
| 354 | + var urlGroups = Object.values(groupedByUrl).sort(function(a, b) { return b.bestScore - a.bestScore; }); | |
| 383 | 355 | var usedUrlCount = sourcesUsed > 0 ? sourcesUsed : urlGroups.filter(function(g) { return g.usedForContext; }).length; |
| 384 | 356 | var chunksInfo = totalChunksUsed > 0 ? totalChunksUsed + ' chunks sent to AI' : topMatches.length + ' chunk matches'; |
| 385 | 357 | |
| 386 | 358 | var html = '<div class="matches-header">' + |
| @@ -405,24 +377,13 @@ | ||
| 405 | 377 | var expandToggle = hasMultipleChunks |
| 406 | 378 | ? '<span class="chunk-expand-toggle" data-group="' + groupIndex + '">▶ Show chunks</span>' |
| 407 | 379 | : ''; |
| 408 | 380 | |
| 409 | - var viaChip = ''; | |
| 410 | - if (hybridOn) { | |
| 411 | - var vias = Object.keys(group.viaSet); | |
| 412 | - if (vias.length) { | |
| 413 | - var viaLabel = (vias.length > 1 || vias[0] === 'both') ? 'Both' | |
| 414 | - : (vias[0] === 'keyword' ? 'Keyword' : 'Vector'); | |
| 415 | - viaChip = '<span class="mxch-rag-via-chip mxch-rag-via-' + viaLabel.toLowerCase() + '">' + viaLabel + '</span>'; | |
| 416 | - } | |
| 417 | - } | |
| 418 | - | |
| 419 | 381 | html += '<div class="match-card ' + cardClass + '">' + |
| 420 | 382 | '<div class="match-header">' + |
| 421 | 383 | '<div class="match-title">' + |
| 422 | 384 | '<span class="status-icon">' + statusIcon + '</span>' + |
| 423 | 385 | '<span class="similarity-score">' + group.bestScore + '%</span>' + |
| 424 | - viaChip + | |
| 425 | 386 | chunkSummary + |
| 426 | 387 | '</div>' + |
| 427 | 388 | '<span class="context-label">' + contextLabel + '</span>' + |
| 428 | 389 | '</div>' + |