test+docs(iace): add handler tests, error-handling tests, JSON export tests, TipTap docs
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 38s
CI/CD / test-python-backend-compliance (push) Successful in 34s
CI/CD / test-python-document-crawler (push) Successful in 29s
CI/CD / test-python-dsms-gateway (push) Successful in 20s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Successful in 2s

- Create iace_handler_test.go (22 tests): input validation for InitFromProfile,
  GenerateSingleSection, ExportTechFile, CheckCompleteness, getTenantID,
  CreateProject, ListProjects, Component CRUD handlers
- Add error-handling tests to tech_file_generator_test.go: nil context, nil project,
  empty components/hazards/classifications/evidence, unknown section type,
  all 19 getSystemPrompt types, AI-specific section prompts
- Add JSON export tests to document_export_test.go: valid output, empty project,
  nil project error, special character handling (German text, XML escapes)
- Add iace-hazard-library.md to mkdocs.yml navigation
- Add TipTap Rich-Text-Editor section to iace.md documentation

Total: 181 tests passing (was 165), 0 failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-16 13:15:31 +01:00
parent 6d2de9b897
commit d2133dbfa2
5 changed files with 779 additions and 0 deletions

View File

@@ -419,6 +419,29 @@ Die Tech-File-Generierung nutzt LLM (Ollama/Anthropic) mit RAG-Kontext aus dem C
| `ai_risk_management` | KI: Risikomanagementsystem |
| `ai_human_oversight` | KI: Menschliche Aufsicht |
#### TipTap Rich-Text-Editor (Frontend)
Die Tech-File-Sektionen werden im Frontend mit einem TipTap WYSIWYG-Editor bearbeitet (`components/sdk/iace/TechFileEditor.tsx`):
| Feature | Beschreibung |
|---------|--------------|
| Toolbar | Bold, Italic, Headings (H2-H4), Bullet/Ordered Lists, Tabelle, Blockquote, Code, Undo/Redo |
| Auto-Save | Debounced (3 Sekunden nach letzter Aenderung), ruft `PUT /tech-file/:section` auf |
| Read-Only | Fuer freigegebene Sektionen (`status: approved`) |
| Markdown-Import | LLM-generierter Markdown-Content wird automatisch in TipTap-Nodes konvertiert |
| HTML-Speicherung | `editor.getHTML()` → Backend speichert HTML in `iace_tech_file_sections.content` |
**Pakete (alle MIT-Lizenz):**
`@tiptap/react`, `@tiptap/starter-kit`, `@tiptap/extension-table`, `@tiptap/extension-table-row`,
`@tiptap/extension-table-header`, `@tiptap/extension-table-cell`, `@tiptap/extension-image`, `@tiptap/pm`
**Workflow:**
1. Sektion generieren → LLM liefert Markdown
2. TipTap konvertiert Markdown → ProseMirror-Nodes
3. Benutzer bearbeitet im WYSIWYG-Editor
4. Auto-Save speichert HTML im Backend
5. Export rendert HTML → PDF/DOCX/Excel/Markdown
### Post-Market Monitoring
| Methode | Pfad | Beschreibung |