KiProtokollRepositoryInterface.php
- Pfad:
src/Domain/Repository/KiProtokollRepositoryInterface.php - Namespace: Domain\Repository
- Zeilen: 92 | Größe: 2,240 Bytes
- Geändert: 2025-12-29 09:08:56 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 94
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 70 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Klassen 1
-
KiProtokollRepositoryInterfaceinterface Zeile 9
Funktionen 13
-
findById()public Zeile 14 -
findLatest()public Zeile 19 -
findPaginated()public Zeile 24 -
countFiltered()public Zeile 32 -
getStatistics()public Zeile 37 -
getDistinctModels()public Zeile 42 -
findPreviousId()public Zeile 44 -
findNextId()public Zeile 46 -
insert()public Zeile 54 -
complete()public Zeile 65 -
fail()public Zeile 76 -
updateRequest()public Zeile 82 -
cleanupStale()public Zeile 90
Verwendet von 7
- DocsController.php constructor
- DocsController.php use
- InfrastructureServiceProvider.php use
- KiProtokollRepository.php use
- KiProtokollRepository.php implements
- KiProtokollService.php constructor
- KiProtokollService.php use
Versionen 2
-
v2
2025-12-29 09:08 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-29 08:42 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php
declare(strict_types=1);
namespace Domain\Repository;
// @responsibility: Contract für KI-Protokoll-Persistenz
interface KiProtokollRepositoryInterface
{
/**
* @return array<string, mixed>|null
*/
public function findById(int $id): ?array;
/**
* @return array<array<string, mixed>>
*/
public function findLatest(int $limit = 20): array;
/**
* @return array<array<string, mixed>>
*/
public function findPaginated(
?string $search = null,
?string $status = null,
?string $model = null,
int $limit = 50,
int $offset = 0
): array;
public function countFiltered(?string $search = null, ?string $status = null, ?string $model = null): int;
/**
* @return array<string, mixed>
*/
public function getStatistics(): array;
/**
* @return array<string>
*/
public function getDistinctModels(): array;
public function findPreviousId(int $id): ?int;
public function findNextId(int $id): ?int;
/**
* Insert new protokoll entry with status 'pending'.
* Sets request_timestamp = NOW(6).
*
* @return int The inserted ID
*/
public function insert(
string $clientName,
string $request,
string $model,
string $requestIp
): int;
/**
* Complete a pending protokoll entry with response data.
* Sets response_timestamp = NOW(6), calculates tokens_total.
*/
public function complete(
int $id,
string $response,
int $durationMs,
?int $tokensInput,
?int $tokensOutput
): void;
/**
* Mark a protokoll entry as failed with error message.
*/
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)
* @return int Number of affected rows
*/
public function cleanupStale(int $minutesOld = 10): int;
}