audit trail detail, dupes detector
This commit is contained in:
@@ -1247,99 +1247,6 @@ class AIQueryInterface {
|
||||
};
|
||||
}
|
||||
|
||||
createSpecificSummary(data, action, type) {
|
||||
if (!data) return 'Leer';
|
||||
|
||||
// Action-specific summaries that provide meaningful information
|
||||
switch (action) {
|
||||
case 'selection-decision':
|
||||
if (type === 'input') {
|
||||
if (data.availableTools && Array.isArray(data.availableTools)) {
|
||||
const preview = data.availableTools.slice(0, 5).join(', ');
|
||||
return `${data.totalAvailable || data.availableTools.length} Tools verfügbar: ${preview}${data.availableTools.length > 5 ? '...' : ''}`;
|
||||
}
|
||||
return `${data.totalAvailable || 0} Tools verfügbar`;
|
||||
} else {
|
||||
return `Ausgewählt: ${Array.isArray(data.selectedTools) ? data.selectedTools.join(', ') : 'keine'}`;
|
||||
}
|
||||
|
||||
case 'phase-tool-selection':
|
||||
if (type === 'input') {
|
||||
if (data.availableTools && Array.isArray(data.availableTools)) {
|
||||
return `${data.availableTools.length} Tools für Phase: ${data.availableTools.slice(0, 3).join(', ')}${data.availableTools.length > 3 ? '...' : ''}`;
|
||||
}
|
||||
return `Phase: ${data.phaseName || data.phaseId || 'unbekannt'} (${data.toolCount || 0} verfügbar)`;
|
||||
} else {
|
||||
if (data.selectedTools && Array.isArray(data.selectedTools)) {
|
||||
return `Ausgewählt: ${data.selectedTools.join(', ')}`;
|
||||
}
|
||||
return `${data.selectionCount || 0} Tools ausgewählt (Ø ${data.avgTaskRelevance || 0}% Relevanz)`;
|
||||
}
|
||||
|
||||
case 'similarity-search':
|
||||
if (type === 'input') {
|
||||
return `Suche: "${data.query}" (Schwelle: ${data.threshold})`;
|
||||
} else {
|
||||
if (data.topMatches && Array.isArray(data.topMatches)) {
|
||||
return `${data.resultsCount} Treffer: ${data.topMatches.slice(0, 3).join(', ')}`;
|
||||
}
|
||||
return `${data.resultsCount || 0} Treffer gefunden`;
|
||||
}
|
||||
|
||||
case 'phase-enhancement':
|
||||
if (type === 'input') {
|
||||
return `Phase: ${data.phaseName || data.phaseId} (${data.searchStrategy || 'Standard'})`;
|
||||
} else {
|
||||
const toolsAdded = Array.isArray(data.addedTools) ? data.addedTools : [];
|
||||
return `${data.toolsAddedCount || toolsAdded.length} Tools hinzugefügt: ${toolsAdded.join(', ') || 'keine'}`;
|
||||
}
|
||||
|
||||
case 'ai-decision':
|
||||
if (type === 'input') {
|
||||
return data.prompt ? `KI-Prompt: ${data.prompt.slice(0, 100)}...` : 'KI-Analyse durchgeführt';
|
||||
} else {
|
||||
return data.response ? `KI-Antwort: ${data.response.slice(0, 100)}...` : 'Antwort erhalten';
|
||||
}
|
||||
|
||||
case 'tool-confidence':
|
||||
if (type === 'input') {
|
||||
return `Tool: ${data.toolName} (Semantik: ${data.semanticSimilarity}%, Aufgabe: ${data.taskRelevance}%)`;
|
||||
} else {
|
||||
return `Vertrauen: ${data.overallConfidence}% (Stärken: ${data.strengthIndicators?.length || 0}, Unsicherheiten: ${data.uncertaintyFactors?.length || 0})`;
|
||||
}
|
||||
|
||||
case 'tool-added-to-phase':
|
||||
if (type === 'input') {
|
||||
return `Tool: ${data.toolName} für ${data.phaseId} (${data.taskRelevance}% Relevanz, ${data.priority} Priorität)`;
|
||||
} else {
|
||||
const justificationPreview = data.justification ? data.justification.slice(0, 80) + '...' : 'Keine Begründung';
|
||||
return `Begründung: ${justificationPreview}`;
|
||||
}
|
||||
|
||||
case 'concept-selection':
|
||||
if (type === 'input') {
|
||||
const availableCount = Array.isArray(data.availableConcepts) ? data.availableConcepts.length : 0;
|
||||
return `${availableCount} Konzepte verfügbar für methodische Fundierung`;
|
||||
} else {
|
||||
const selectedConcepts = Array.isArray(data.selectedConcepts) ? data.selectedConcepts : [];
|
||||
return `${selectedConcepts.length} ausgewählt: ${selectedConcepts.slice(0, 3).join(', ')}${selectedConcepts.length > 3 ? '...' : ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to generic handling for other actions
|
||||
if (typeof data === 'string') {
|
||||
return data.length > 100 ? data.slice(0, 100) + '...' : data;
|
||||
}
|
||||
|
||||
if (Array.isArray(data)) {
|
||||
if (data.length === 0) return 'Leeres Array';
|
||||
if (data.length <= 3) return data.join(', ');
|
||||
return `${data.slice(0, 3).join(', ')} und ${data.length - 3} weitere`;
|
||||
}
|
||||
|
||||
return `${Object.keys(data).length} Eigenschaften`;
|
||||
}
|
||||
|
||||
renderPhaseGroups(auditTrail, stats) {
|
||||
const phaseGroups = new Map();
|
||||
|
||||
@@ -1439,26 +1346,23 @@ class AIQueryInterface {
|
||||
|
||||
renderDetailedEntryInfo(entry) {
|
||||
const details = [];
|
||||
const input = entry.input || {};
|
||||
const output = entry.output || {};
|
||||
const metadata = entry.metadata || {};
|
||||
|
||||
// Show input summary with action-specific formatting
|
||||
// The backend now provides meaningful inputSummary and outputSummary
|
||||
if (metadata.inputSummary && metadata.inputSummary !== 'Leer') {
|
||||
details.push(`<div class="detail-item"><strong>Eingabe:</strong> ${escapeHtml(metadata.inputSummary)}</div>`);
|
||||
}
|
||||
|
||||
// Show output summary with action-specific formatting
|
||||
if (metadata.outputSummary && metadata.outputSummary !== 'Leer') {
|
||||
details.push(`<div class="detail-item"><strong>Ausgabe:</strong> ${escapeHtml(metadata.outputSummary)}</div>`);
|
||||
}
|
||||
|
||||
// Show reasoning - this is now meaningful, not generic
|
||||
// Show meaningful reasoning (backend now avoids generic "completed with X%" messages)
|
||||
if (metadata.reasoning && !metadata.reasoning.includes('completed with')) {
|
||||
details.push(`<div class="detail-item"><strong>Begründung:</strong> ${escapeHtml(metadata.reasoning)}</div>`);
|
||||
}
|
||||
|
||||
// Show specific details based on action type
|
||||
// Action-specific additional details
|
||||
if (entry.action === 'similarity-search' && metadata.similarityScores) {
|
||||
const topScores = Object.entries(metadata.similarityScores)
|
||||
.sort(([,a], [,b]) => (b) - (a))
|
||||
@@ -1477,10 +1381,13 @@ class AIQueryInterface {
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.action === 'selection-decision' && metadata.selectionMethod) {
|
||||
details.push(`<div class="detail-item"><strong>Auswahlmethode:</strong> ${metadata.selectionMethod}</div>`);
|
||||
if (entry.action === 'selection-decision') {
|
||||
if (metadata.selectionMethod) {
|
||||
const methodDisplay = metadata.selectionMethod === 'embeddings_candidates' ? 'Semantische Filterung' : 'Vollständige Analyse';
|
||||
details.push(`<div class="detail-item"><strong>Methode:</strong> ${methodDisplay}</div>`);
|
||||
}
|
||||
if (metadata.reductionRatio) {
|
||||
details.push(`<div class="detail-item"><strong>Reduktion:</strong> ${(metadata.reductionRatio * 100).toFixed(1)}% der verfügbaren Tools</div>`);
|
||||
details.push(`<div class="detail-item"><strong>Filterung:</strong> ${(metadata.reductionRatio * 100).toFixed(1)}% der verfügbaren Tools</div>`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1501,6 +1408,15 @@ class AIQueryInterface {
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.action === 'phase-enhancement') {
|
||||
if (metadata.semanticSimilarity) {
|
||||
details.push(`<div class="detail-item"><strong>Semantische Ähnlichkeit:</strong> ${(metadata.semanticSimilarity * 100).toFixed(1)}%</div>`);
|
||||
}
|
||||
if (metadata.aiReasoningUsed) {
|
||||
details.push(`<div class="detail-item"><strong>KI-Begründung:</strong> Verwendet für Auswahl</div>`);
|
||||
}
|
||||
}
|
||||
|
||||
if (details.length === 0) return '';
|
||||
|
||||
return `
|
||||
|
||||
Reference in New Issue
Block a user