{
"event": "PreToolUse",
"tool_name": "mcp__mcp-tasks__tasks_create",
"tool_input": {
"title": "Qdrant Payload-Schema vereinheitlichen (documents vs dokumentation_chunks)",
"description": "# Problem\n\nDie Qdrant-Collections haben **inkonsistente Payload-Schemas**:\n\n## documents Collection\n```json\n{\n \"document_id\": 13,\n \"document_title\": \"Booklet_XYZ.pdf\",\n \"content\": \"Vollständiger Chunk-Text...\",\n \"chunk_index\": 17,\n \"heading_path\": [\"Seite 13\"],\n \"source_path\": \"\/var\/www\/nextcloud\/...\"\n}\n```\n\n## dokumentation_chunks Collection\n```json\n{\n \"chunk_id\": 385,\n \"doc_id\": 64,\n \"title\": \"Semantic Explorer\",\n \"content_preview\": \"Kurzer Preview...\",\n \"path\": \"\/anwendungen\/semantic-explorer\",\n \"taxonomy\": [\"Anwendungen\", \"...\"],\n ...\n}\n```\n\n## Auswirkung\n\n- `ChatService.php` erwartet `document_title` und `content`\n- `dokumentation_chunks` liefert `title` und `content_preview`\n- Ergebnis: **Leere Quellen trotz gefundener Chunks**\n\n## Lösungsoptionen\n\n### Option A: Schema vereinheitlichen (EMPFOHLEN)\nBeide Collections auf gleiches Schema migrieren:\n- `document_title` → Standard-Feld für Titel\n- `content` → Standard-Feld für Volltext\n\n### Option B: ChatService flexibel machen\nChatService prüft beide Feldnamen:\n```php\n$title = $payload['document_title'] ?? $payload['title'] ?? '';\n$content = $payload['content'] ?? $payload['content_preview'] ?? '';\n```\n\n## Betroffene Dateien\n\n- `src\/Infrastructure\/AI\/ChatService.php` (buildContext, extractSources)\n- Pipeline für dokumentation_chunks (Schema-Erzeugung)\n- Qdrant dokumentation_chunks Collection (Re-Indexierung)",
"type": "ai_task"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"task\": {\n \"id\": 310,\n \"uuid\": \"c6b7c48f-9b9c-4bdd-ae6d-5e7a59858588\",\n \"title\": \"Qdrant Payload-Schema vereinheitlichen (documents vs dokumentation_chunks)\",\n \"description\": \"# Problem\\n\\nDie Qdrant-Collections haben **inkonsistente Payload-Schemas**:\\n\\n## documents Collection\\n```json\\n{\\n \\\"document_id\\\": 13,\\n \\\"document_title\\\": \\\"Booklet_XYZ.pdf\\\",\\n \\\"content\\\": \\\"Vollständiger Chunk-Text...\\\",\\n \\\"chunk_index\\\": 17,\\n \\\"heading_path\\\": [\\\"Seite 13\\\"],\\n \\\"source_path\\\": \\\"\/var\/www\/nextcloud\/...\\\"\\n}\\n```\\n\\n## dokumentation_chunks Collection\\n```json\\n{\\n \\\"chunk_id\\\": 385,\\n \\\"doc_id\\\": 64,\\n \\\"title\\\": \\\"Semantic Explorer\\\",\\n \\\"content_preview\\\": \\\"Kurzer Preview...\\\",\\n \\\"path\\\": \\\"\/anwendungen\/semantic-explorer\\\",\\n \\\"taxonomy\\\": [\\\"Anwendungen\\\", \\\"...\\\"],\\n ...\\n}\\n```\\n\\n## Auswirkung\\n\\n- `ChatService.php` erwartet `document_title` und `content`\\n- `dokumentation_chunks` liefert `title` und `content_preview`\\n- Ergebnis: **Leere Quellen trotz gefundener Chunks**\\n\\n## Lösungsoptionen\\n\\n### Option A: Schema vereinheitlichen (EMPFOHLEN)\\nBeide Collections auf gleiches Schema migrieren:\\n- `document_title` → Standard-Feld für Titel\\n- `content` → Standard-Feld für Volltext\\n\\n### Option B: ChatService flexibel machen\\nChatService prüft beide Feldnamen:\\n```php\\n$title = $payload['document_title'] ?? $payload['title'] ?? '';\\n$content = $payload['content'] ?? $payload['content_preview'] ?? '';\\n```\\n\\n## Betroffene Dateien\\n\\n- `src\/Infrastructure\/AI\/ChatService.php` (buildContext, extractSources)\\n- Pipeline für dokumentation_chunks (Schema-Erzeugung)\\n- Qdrant dokumentation_chunks Collection (Re-Indexierung)\",\n \"type\": \"ai_task\",\n \"status\": \"pending\",\n \"created_by\": \"mcp-tasks\",\n \"created_by_type\": \"ai\",\n \"parent_task_id\": null,\n \"due_date\": null,\n \"created_at\": \"2025-12-25T01:55:32.360873\",\n \"updated_at\": \"2025-12-25T01:55:32.360874\",\n \"completed_at\": null,\n \"metadata\": {}\n },\n \"message\": \"Task #310 created\"\n}"
}
]
}