{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/Repository\/KiProtokollRepositoryInterface.php",
"old_string": " \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;",
"new_string": " \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;\n\n \/**\n * Update the request field with the full LLM prompt.\n * Called after prompt construction, before LLM call.\n *\/\n public function updateRequest(int $id, string $fullRequest): void;"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/Repository\/KiProtokollRepositoryInterface.php",
"oldString": " \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;",
"newString": " \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;\n\n \/**\n * Update the request field with the full LLM prompt.\n * Called after prompt construction, before LLM call.\n *\/\n public function updateRequest(int $id, string $fullRequest): void;",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\Repository;\n\n\/\/ @responsibility: Contract für KI-Protokoll-Persistenz\n\ninterface KiProtokollRepositoryInterface\n{\n \/**\n * @return array<string, mixed>|null\n *\/\n public function findById(int $id): ?array;\n\n \/**\n * @return array<array<string, mixed>>\n *\/\n public function findLatest(int $limit = 20): array;\n\n \/**\n * @return array<array<string, mixed>>\n *\/\n public function findPaginated(\n ?string $search = null,\n ?string $status = null,\n ?string $model = null,\n int $limit = 50,\n int $offset = 0\n ): array;\n\n public function countFiltered(?string $search = null, ?string $status = null, ?string $model = null): int;\n\n \/**\n * @return array<string, mixed>\n *\/\n public function getStatistics(): array;\n\n \/**\n * @return array<string>\n *\/\n public function getDistinctModels(): array;\n\n public function findPreviousId(int $id): ?int;\n\n public function findNextId(int $id): ?int;\n\n \/**\n * Insert new protokoll entry with status 'pending'.\n * Sets request_timestamp = NOW(6).\n *\n * @return int The inserted ID\n *\/\n public function insert(\n string $clientName,\n string $request,\n string $model,\n string $requestIp\n ): int;\n\n \/**\n * Complete a pending protokoll entry with response data.\n * Sets response_timestamp = NOW(6), calculates tokens_total.\n *\/\n public function complete(\n int $id,\n string $response,\n int $durationMs,\n ?int $tokensInput,\n ?int $tokensOutput\n ): void;\n\n \/**\n * Mark a protokoll entry as failed with error message.\n *\/\n public function fail(int $id, string $errorMessage): void;\n\n \/**\n * Mark stale 'pending' entries as 'error'.\n *\n * @param int $minutesOld Age threshold in minutes (default: 10)\n * @return int Number of affected rows\n *\/\n public function cleanupStale(int $minutesOld = 10): int;\n}\n",
"structuredPatch": [
{
"oldStart": 76,
"oldLines": 6,
"newStart": 76,
"newLines": 12,
"lines": [
" public function fail(int $id, string $errorMessage): void;",
" ",
" \/**",
"+ * Update the request field with the full LLM prompt.",
"+ * Called after prompt construction, before LLM call.",
"+ *\/",
"+ public function updateRequest(int $id, string $fullRequest): void;",
"+",
"+ \/**",
" * Mark stale 'pending' entries as 'error'.",
" *",
" * @param int $minutesOld Age threshold in minutes (default: 10)"
]
}
],
"userModified": false,
"replaceAll": false
}
}