This commit is contained in:
overcuriousity
2025-08-18 00:57:57 +02:00
parent 1d91dbf478
commit 6160620e24
5 changed files with 13 additions and 54 deletions

View File

@@ -107,7 +107,6 @@ class AIPipeline {
const aiConfig = aiService.getConfig();
const toolsDataHash = getDataVersion?.() || 'unknown';
// Record the tools.yaml version being used
auditService.addEntry(
'initialization',
'tools-data-loaded',
@@ -747,7 +746,7 @@ class AIPipeline {
prompt,
result.content,
confidence,
`Analysierte ${isWorkflow ? 'Szenario' : 'Problem'} basierend auf Nutzereingabe: "${context.userQuery.slice(0, 100)}..." - Identifizierte Kernaspekte und Herausforderungen für forensische Untersuchung`,
`Analysierte ${isWorkflow ? 'Szenario' : 'Problem'} basierend auf Nutzereingabe: "${context.userQuery.slice(0, 100)}..." - Identifizierte Kernaspekte und Herausforderungen für Untersuchung`,
taskStart,
{
toolsDataHash: toolsDataHash,
@@ -1184,21 +1183,18 @@ class AIPipeline {
try {
const response = await aiService.callMicroTaskAI(contextPrompt);
// FIX: Ensure ALL AI calls generate audit entries
const toolsDataHash = getDataVersion?.() || 'unknown';
const aiConfig = aiService.getConfig();
// Calculate response confidence for audit trail
const responseConfidence = auditService.calculateAIResponseConfidence(
response.content,
this.getExpectedLengthForTaskType(taskType),
taskType
);
// FIX: Always add AI decision audit entry for micro-tasks
auditService.addAIDecision(
this.getPhaseForTaskType(taskType),
prompt, // Store original prompt without context
prompt,
response.content,
responseConfidence,
this.getReasoningForTaskType(taskType, response.content),
@@ -1224,7 +1220,6 @@ class AIPipeline {
};
} catch (error) {
// FIX: Also audit failed AI calls for completeness
auditService.addEntry(
this.getPhaseForTaskType(taskType),
'ai-decision-failed',
@@ -1237,7 +1232,7 @@ class AIPipeline {
error: error.message,
success: false
},
0, // Zero confidence for failed calls
0,
startTime,
{
toolsDataHash: getDataVersion?.() || 'unknown',
@@ -1299,7 +1294,7 @@ class AIPipeline {
};
const taskName = taskNames[taskType] || taskType;
return `KI generierte ${taskName} (${responseLength} Zeichen) - forensisch fundierte Analyse mit methodischer Begründung`;
return `KI generierte ${taskName} (${responseLength} Zeichen) - Analyse mit methodischer Begründung`;
}
private addToContextHistory(context: PipelineContext, newEntry: string): void {