922c846b03
chore: Remove generated test results file
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-05 07:47:00 +02:00
7deca6c64d
test: Add unit tests for End Node Template Engine
...
Build Test / lint-backend (push) Waiting to run
Build Test / build-frontend (push) Waiting to run
Deploy Development / deploy (push) Has been cancelled
- test_end_node_template.py: Tests for execute_end_node()
- Tests AUTO mode (backward compatible concatenation)
- Tests TEMPLATE mode (Jinja2 rendering, conditionals)
- Tests error handling (missing template, syntax errors)
Note: Tests require Jinja2, run in Docker or CI/CD environment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:46:49 +02:00
fac76c28da
fix: Handle None workflow_id in success path
...
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Also use 'N/A' placeholder in ExecutionResult when workflow_id is None
(when using graph_data directly instead of workflow_definitions).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:28:30 +02:00
6016eec250
fix: Add ON CONFLICT to workflow_executions insert
...
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Prevents duplicate key violation when save_execution_state is called
multiple times with the same execution_id (e.g., during error handling).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:26:10 +02:00
c95b4e185d
fix: Edge format normalization and nullable workflow_id
...
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Fixes:
1. Edge Format Mismatch:
- graph_data uses React Flow format (source/target)
- WorkflowEdge expects backend format (from/to)
- Added normalization in parse_workflow_graph()
2. UUID Validation Error:
- workflow_id can be None when using graph_data (Phase 5)
- save_execution_state now accepts Optional[str]
- ExecutionResult uses "N/A" placeholder when None
Changes:
- workflow_engine.py: normalize edges before Pydantic validation
- workflow_executor.py: Optional[str] for workflow_id parameter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:22:32 +02:00
fe28cce921
fix: Workflow executor graph parsing and error handling
...
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
Fixes:
- graph_data was incorrectly json.dumps() encoded (should stay as dict)
- workflow_id=None in error handler caused ValidationError
- parse_workflow_graph expects Dict, not str
Changes:
- Use graph_dict directly instead of json.dumps(graph_data)
- Set workflow_id="" when None in error handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:18:43 +02:00
b888f5d3c8
feat: Phase 4 - End Node Template Engine (v0.9n)
...
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Backend:
- workflow_models.py: EndNodeOutputMode enum (AUTO, TEMPLATE)
- workflow_executor.py: execute_end_node() with Jinja2 rendering
- Template Context: {{node_id.analysis_core}}, {{node_id.decision_signals.key}}
- Conditional Rendering: {% if node_id %} for optional paths
- AUTO Mode: Backward compatible (concatenates all analyses)
- TEMPLATE Mode: Custom Jinja2 templates with placeholders
Features:
- Access node results: {{node_id.analysis_core}}
- Access signals: {{node_id.decision_signals.relevanz}}
- Optional paths: {% if node_id %}...{% endif %}
- Default values: {{node_id|default("N/A")}}
Version: 0.9n
Module: workflow 0.6.0
Konzept: konzept_workflow_engine_konsolidated.md (Section 11)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:07:49 +02:00
cab5758b0d
fix: Save prompt_name in graph_data for readable node display
...
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Bug:
- Analysis nodes showed "Prompt #7edc6d6b-6cd5..." in canvas
- After re-selecting prompt, showed readable name "Pipeline: Ernährungs-Analyse"
- After loading workflow, showed UUID again
Root Cause:
- Serializer saved only prompt_id, not prompt_name
- Deserializer expected prompt_name but got null
- AnalysisNode fallback logic: data.prompt_name || `Prompt #{prompt_id}`
- Result: Showed UUID as fallback
Fix:
- workflowSerializer.js line 25: Added prompt_name to serialization
- Now saves both prompt_id AND prompt_name in graph_data
- On load: prompt_name is restored → AnalysisNode shows readable name
Testing:
- Create workflow with analysis node + prompt selection
- Save → Canvas should show "Pipeline: Körper-Analyse" (not UUID)
- Reload → Canvas should still show readable name (not UUID)
2026-04-04 22:50:40 +02:00
d9bcaaaac6
fix: Add missing GET /api/prompts/{id} endpoint
...
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Critical Backend Bug:
- Frontend calls api.getPrompt(id) → GET /api/prompts/{uuid}
- Backend had NO endpoint for single prompt retrieval by ID
- Result: 405 Method Not Allowed
Backend Endpoints Before:
✓ GET /api/prompts - List all
✓ POST /api/prompts - Create
✓ PUT /api/prompts/{id} - Update
✗ GET /api/prompts/{id} - MISSING!
Backend Endpoints After:
✓ GET /api/prompts - List all
✓ GET /api/prompts/{id} - Get single (NEW)
✓ POST /api/prompts - Create
✓ PUT /api/prompts/{id} - Update
Implementation:
- Added get_prompt(prompt_id: str) function
- Returns single prompt by UUID
- 404 if not found
- Requires auth (admin or user)
This fixes:
- Workflow loading after save (loadWorkflow calls getPrompt)
- Workflow editing from admin list (Edit button calls getPrompt)
- All 405 Method Not Allowed errors
Root Cause: Backend was incomplete, missing basic CRUD read-by-id endpoint
2026-04-04 22:43:07 +02:00
84c1fa3c1d
fix: UUID handling - remove parseInt() for prompt IDs
...
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
Critical Bug Fixes:
1. Prompt IDs are UUIDs (strings), NOT numbers
2. parseInt(UUID) produces wrong results:
- parseInt("3b4d7d64-...") = 3 (truncates at first non-digit)
- parseInt("aa291dde-...") = NaN
3. This caused:
- Prompt selection: saved as NaN instead of UUID
- Load workflow: GET /api/prompts/3 instead of /api/prompts/3b4d7d64-...
- 405 Method Not Allowed errors
Changes:
- useEffect: loadWorkflow(id) instead of loadWorkflow(parseInt(id))
- Prompt onChange: prompt_id: promptId (string) instead of parseInt(promptId)
- Removed NaN check (unnecessary for UUID strings)
Root Cause: Backend uses UUID primary keys, frontend assumed integer IDs
Testing: Console logs still active for verification
2026-04-04 22:39:08 +02:00
2b8bebd381
debug: Add comprehensive console logging for workflow editor debugging
...
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Debug Logs Added:
- useEffect: Log ID validation and loadWorkflow calls
- loadWorkflow: Log API response, graph_data, deserialization results
- handleNodeUpdate: Log updates and resulting node state
- handleSave: Log serialization, API calls, navigation
Bug Fixes:
- useEffect: Add !isNaN(parseInt(id)) check to prevent /api/prompts/NaN calls
- Prompt selection: String conversion for value prop (Number vs String mismatch)
- <select value={String(selectedNode.data.prompt_id)}>
- <option value={String(prompt.id)}>
- onChange: find with String(p.id) === promptId
Issues to Debug:
- Why does useEffect run with id=undefined after navigate?
- Why does loadWorkflow not populate nodes/edges?
- Why does prompt selection not persist?
Next Step: User tests with Browser Console open, reports logs
2026-04-04 22:30:43 +02:00
2f70a39052
fix: Phase 5 - Workflow Editor UX Fixes (Round 3)
...
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Frontend Fixes:
- AdminPromptsPage: Edit button navigates to workflow-editor for workflow type prompts
- WorkflowEditorPage: Fixed save navigation (alert before navigate)
- WorkflowEditorPage: selectedNode derived from selectedNodeId (eliminates stale state)
- FallbackConfig: Show node labels instead of IDs in fallback edge dropdown
- WorkflowCanvas: Enable edge deletion with deletable: true
- WorkflowEditorPage: Hide sidebar when config panel is open
Bugs Fixed:
- C1: Save error "Method Not Allowed" after success
- C2: Edit button in admin doesn't open workflow editor
- H1: Prompt selection not displayed when re-editing node
- H2: Fallback edge dropdown shows node_1/node_2 instead of names
- H3: Cannot delete edges
- M1: Sidebar takes space when config panel open
Technical Changes:
- Replaced useState(selectedNode) with useState(selectedNodeId) + derived selectedNode
- Removed sync useEffect (no longer needed with derived state)
- Added nodes prop to FallbackConfig for label lookup
- Swapped alert/navigate order to prevent navigation errors
Testing: Manual testing required (see manual test cases)
2026-04-04 21:16:15 +02:00
7d22b052dd
fix: Phase 5 - Workflow save + node persistence bugs
...
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
KRITISCHE FIXES:
1. Backend: Workflow-Type Support
- models.py: graph_data Feld hinzugefügt
- models.py: slug Optional (auto-generiert)
- prompts.py: 'workflow' in erlaubten Typen
- prompts.py: graph_data in INSERT/UPDATE
- prompts.py: Auto-Slug-Generierung aus Name
- FIX: "Field required: slug" Error behoben
2. Frontend: Node-Updates Persistence
- selectedNode sync mit nodes array (useEffect)
- FIX: Änderungen gingen verloren (stale state)
- FIX: Prompt-Auswahl nicht sichtbar nach Edit
- FIX: Fallback-Strategy nicht gespeichert
- FIX: Node-Name Änderungen nicht übernommen
BEHOBEN:
- ❌ Save fehlgeschlagen → ✅ Workflows speicherbar
- ❌ Node-Name ignoriert → ✅ Live-Update
- ❌ Prompt verschwindet → ✅ Bleibt sichtbar
- ❌ Fallback nicht saved → ✅ Persistiert
Tested: Backend API akzeptiert jetzt type='workflow'
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:17:41 +02:00
e3ef18674a
fix: Phase 5 - Critical UX bugs in Workflow Editor
...
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Behebt 5 kritische Bugs die Editor unbenutzbar machten:
BUG-01: Config Panel - Close Button hinzugefügt (×)
- User war im Config Panel "gefangen"
- Jetzt: Click × zum Deselektieren
BUG-02: Save UX - Validierungs-Feedback verbessert
- Speichern-Button zeigt Lock-Icon (🔒 ) bei Fehlern
- Tooltip erklärt warum Speichern blockiert ist
- Error-Message mit Hinweis auf Validierung
BUG-03: Analysis Node - Prompt-Auswahl implementiert
- Dropdown zum Auswählen von Basis-Prompts
- Lädt verfügbare Prompts via API
- Zeigt gewählten Prompt-Namen an
BUG-04: Label-Input - UX verbessert
- Header zeigt "Node-Konfiguration" (nicht Label)
- Input hat Placeholder und Hilfetext
- "Änderungen automatisch übernommen" Hinweis
BUG-05: Admin Page - "Neuer Workflow" Button
- Button neben "+ Neuer Prompt"
- Navigiert zu /workflow-editor/new
- Workflow-Filter im Type-Filter hinzugefügt
Tested: Manuell durch User (alle Bugs bestätigt gefixt)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 18:59:47 +02:00
dc59596f01
feat: Phase 5 - Visual Workflow Editor (Option B)
...
Deploy Development / deploy (push) Failing after 1s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
Backend (Mini-Backend 1-2h):
- Migration 016: ai_prompts.graph_data JSONB column
- workflow_executor: graph_data parameter support (backward-compatible)
- prompt_executor: execute_workflow_prompt uses graph_data
Frontend (Main effort 25-35h):
- WorkflowCanvas: React Flow wrapper component
- 5 Custom Nodes: Start, End, Analysis, Logic, Join
- 4 Config Panels: QuestionAugmentation, LogicExpression, Fallback, Join
- workflowValidation: Structural + logical validation
- workflowSerializer: Canvas ↔ JSONB conversion
- WorkflowEditorPage: Main orchestration (420 LOC)
- Route: /workflow-editor/:id
- CSS: workflowEditor.css (300 LOC)
Architecture:
- Option B: ai_prompts.type='workflow' (not separate table)
- panels/ subdirectory for clean separation
- WorkflowCanvas reusable component
- User GUI identical (Workflows = Prompts)
- Backward-compatible (type='pipeline' unchanged)
Version: v0.9m → v0.9n (Phase 5 complete)
Module: workflow 0.5.0 → 0.6.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 17:56:00 +02:00
a7058c30be
feat: Enhance EmojiIconPicker with search functionality and keyword support
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-04 14:22:44 +02:00
2101080719
feat: Expand EmojiIconPicker with additional curated emoji groups and enhance functionality for custom groups
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
2026-04-04 14:17:35 +02:00
5aae999a65
feat: Add EmojiIconPicker component and integrate it into Admin pages for icon selection
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
2026-04-04 14:07:54 +02:00
dc87e7f3b8
cursor_Setup
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-04 14:05:50 +02:00
c607cd1833
fix: Convert joined signals Dict to List for NodeExecutionState
...
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 22s
NodeExecutionState expects normalized_signals as List[NormalizedSignal],
but join_evaluator returns Dict[str, NormalizedSignal].
Fix: Convert dict to list before returning NodeExecutionState.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 12:33:58 +02:00
e2a132353d
feat: Phase 4 - Join Nodes and Path Consolidation
...
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Backend Implementation (v0.9m, workflow 0.5.0):
- join_evaluator.py (394 lines): Join-Strategie-Evaluator
- evaluate_join_node(): Hauptlogik für Join-Node Execution
- Join-Strategien: wait_all, wait_any, best_effort
- Skip-Handling: ignore_skipped, use_placeholder, require_minimum
- Result Consolidation: merge analysis_cores, combine signals
- Partial Execution: korrekte Behandlung von SKIPPED/FAILED Pfaden
- workflow_executor.py: execute_join_node() Integration
- BFS-Traversierung erweitert für Join-Nodes
- NodeExecutionState List → Dict Konvertierung für Signale
- Signal-Name-Kollisionen via node_id Präfix gelöst
Testing (49 Tests passing):
- test_phase4_join_nodes.py: 18 neue Unit Tests
- Join-Strategien (wait_all, wait_any, best_effort)
- Skip-Handling (ignore, placeholder)
- Result Consolidation (merge, combine)
- Partial Execution (mixed status paths)
- Helper Functions (collect, check, merge, combine)
- Backward Compatibility: 31 Phase 2/3 Tests (alle passing)
- test_phase2_workflow_executor.py: 1 Test aktualisiert
- test_phase3_logic_evaluator.py: 20 Tests unverändert
Konzept: konzept_workflow_engine_konsolidated.md (Sektion 8.8)
Anforderungsanalyse: phase4_anforderungsanalyse.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 12:27:31 +02:00
2ce0874dcb
feat: Phase 3 - Logic Nodes + Conditional Branching
...
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Backend:
- logic_evaluator.py (NEU, 307 Zeilen): Deterministischer Logic Evaluator
- Vergleichsoperatoren: EQ, NEQ, IN, NOT_IN, GT, LT, GTE, LTE, CONTAINS
- Logische Operatoren: AND, OR, NOT mit Verschachtelung
- Resolve signal references (node_id.question_type)
- Error handling für UNCLEAR/INVALID/NOT_DECIDABLE Signale
- workflow_executor.py (ERWEITERT):
- execute_logic_node(): Bedingungen evaluieren, Pfade aktivieren/deaktivieren
- execute_workflow(): BFS-Traversierung mit Edge-Activation statt Sequential
- _apply_fallback(): 4 Fallback-Strategien (CONSERVATIVE_SKIP, DEFAULT_PATH, UNCERTAINTY_PATH, DOCUMENT_ONLY)
- _has_active_incoming_edge(): Prüft ob Node erreichbar ist
- _get_edges_by_label(): Findet then/else/uncertainty Pfade
- workflow_models.py (ERWEITERT):
- LogicOperator.CONTAINS hinzugefügt
- version.py: 0.9k → 0.9l, workflow 0.3.0 → 0.4.0
Tests:
- test_phase3_logic_evaluator.py (NEU): 20 Unit Tests (alle passing)
- Comparison operators (EQ, NEQ, IN, GT, LT, CONTAINS)
- Logical operators (AND, OR, NOT)
- Nested expressions
- Error handling (missing refs, UNCLEAR/INVALID signals)
- test_phase2_workflow_executor.py (AKTUALISIERT): 11 Tests (alle passing)
- execute_node() graph parameter hinzugefügt (Phase 3 requirement)
- test_execute_node_unknown_type: logic → join (logic jetzt implementiert)
- test_phase3_workflow_branching.py (NEU): Integration Tests vorbereitet
- Erfordert vollständige DB-Mock-Strategie (wird in E2E-Test nachgeholt)
Phase 2 Backward Compatibility: ✅ Alle Phase 2 Tests bestehen weiterhin
Konzept: .claude/task/Workflow_engine_prompting_engine/konzept_workflow_engine_konsolidated.md
Anforderungsanalyse: .claude/task/Workflow_engine_prompting_engine/phase3_anforderungsanalyse.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 08:02:22 +02:00
16dc08cd7d
test: Add regression test for hybrid model - node spectrum overrides catalog
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-03 21:55:19 +02:00
c588372f3a
fix: Hybrid model - node-specific question spectrums override catalog (Phase 1 requirement)
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 21s
2026-04-03 21:49:13 +02:00
585f189b13
fix: Remove extra_vars parameter from resolve_placeholders call - function doesn't support it yet
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
2026-04-03 21:44:39 +02:00
acd4830795
fix: Access topological_order directly from engine, not from non-existent validator attribute
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
2026-04-03 21:38:45 +02:00
ac2e7cf5bb
fix: Use dict keys for all RealDictCursor row access in Phase 2 code
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 15s
2026-04-03 21:36:44 +02:00
0725461056
fix: Use dict keys instead of numeric indices for RealDictCursor rows
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-03 21:34:47 +02:00
ce4666a535
fix: Import call_openrouter from routers.prompts instead of non-existent openrouter module
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
2026-04-03 21:33:09 +02:00
1f8791f4dd
feat: Phase 2 - Normalisierung + Workflow Executor
...
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Backend:
- normalization_engine.py (200 Zeilen): Synonym-Mapping, 5 Statuswerte
* normalize_decision_signal(): Kaskade (exact → case → synonym → invalid)
* apply_synonym_mapping(): DB-basierte Synonyme (case-insensitive)
* normalize_all_signals(): Batch-Processing gegen Katalog
* load_question_catalog(): Lädt normalization_rules aus DB
- workflow_executor.py (440 Zeilen): Sequenzielle Workflow-Ausführung
* execute_workflow(): Traversiert DAG in topologischer Reihenfolge
* execute_node(): Führt analysis nodes aus (start/end = no-op)
* aggregate_results(): Kombiniert analysis_core + normalized_signals
* save_execution_state(): Persistiert in workflow_executions
- workflow_models.py: Erweitert um Phase 2 Models
* SignalStatus Enum (valid, normalized, unclear, invalid, not_decidable)
* NormalizedSignal (question_type, raw_value, normalized_value, status)
* NodeExecutionState (node_id, status, analysis_core, normalized_signals)
* ExecutionResult (execution_id, workflow_id, status, node_states, aggregated_result)
- workflow_engine.py: Neue Funktion get_execution_order()
* Flattened topological sort für sequenzielle Execution
* Phase 7: Wird zu levels (parallele Execution)
- prompt_executor.py: execute_workflow_prompt() Implementierung
* Ruft workflow_executor.execute_workflow() auf
* Konvertiert ExecutionResult zu API-Response
- routers/workflows.py (230 Zeilen): Workflow Execution API
* POST /api/workflows/{id}/execute (mit enable_debug)
* GET /api/workflows/executions/{id} (lädt gespeicherten State)
* GET /api/workflows (listet alle aktiven Workflows)
* GET /api/workflows/{id} (lädt einzelnen Workflow mit Graph)
- main.py: Router-Registrierung (workflows.router)
Tests:
- test_phase2_normalization.py (17 Tests): Alle Normalisierungs-Szenarien
* Exact match, case-insensitive, synonym mapping, invalid, whitespace
* Batch-Normalisierung, not_in_catalog, mixed validity
- test_phase2_workflow_executor.py (10 Tests): Executor + Aggregation
* aggregate_results mit verschiedenen Konstellationen
* execute_node für start/end/analysis/unknown
* Integration mit question_augmenter + result_container_parser
Alle 27 Unit-Tests bestanden.
version: 0.9k (backend)
module: workflow 0.3.0
Konzept: .claude/task/Workflow_engine_prompting_engine/anforderungsanalyse_umsetzungsplan.md (Phase 2)
2026-04-03 21:20:23 +02:00
ca562b7130
feat: Phase 1 - Fragenergänzung + Strukturierter Container
...
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Backend:
- question_augmenter.py (290 Zeilen): Hybrid-Modell für Fragenergänzungen
* merge_question_augmentations(): Knotengebundene Fragen überschreiben Prompt-Defaults
* augment_prompt_with_questions(): Markdown-formatierte Fragenergänzung
* parse_question_augmentations_from_jsonb(): JSONB → QuestionAugmentation[]
- result_container_parser.py (250 Zeilen): Markdown-Sektionen-Parsing
* parse_result_container(): Extrahiert Analysekern, Entscheidungsanteil, Begründungsanker
* validate_decision_signal(): Normalisierung gegen answer_spectrum
* Fallback-Parsing bei unstrukturierten Antworten
- routers/workflow_questions.py (236 Zeilen): CRUD für workflow_question_catalog
* GET /api/workflow/questions (mit active_only Filter)
* POST/PUT/DELETE (Admin only, Soft Delete)
- prompt_executor.py: Integration in execute_base_prompt()
* Fragenergänzung vor LLM-Call (wenn node_questions oder catalog vorhanden)
* Result-Container-Parsing nach LLM-Response
- main.py: Router-Registrierung (workflow_questions)
Tests:
- test_phase1_question_augmenter.py (8 Tests): Hybrid-Modell, Formatierung, JSONB-Parsing
- test_phase1_result_container_parser.py (17 Tests): Sektion-Extraktion, Decision-Parsing, Validierung
Alle 25 Unit-Tests bestanden.
version: 0.9j (backend)
module: workflow 0.2.0
Konzept: .claude/task/Workflow_engine_prompting_engine/konzept_workflow_engine_konsolidated.md (Phase 1)
2026-04-03 18:02:25 +02:00
b5be6e21a5
feat: Phase 0 - Workflow Engine Foundation
...
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Backend:
- DB-Migration 034: workflow_definitions, workflow_question_catalog, workflow_executions
- ai_prompts.question_augmentations JSONB-Spalte (Hybridmodell: Prompt-Defaults)
- 6 Grundtypen Fragenergänzungen mit Normalisierungsregeln (Seed-Daten)
- Pydantic-Modelle (16 Models, 11 Enums) in workflow_models.py
- Workflow-Engine: Graph-Parsing, Topologische Sortierung, DAG-Validierung
- Dispatcher-Erweiterung type='workflow' (Stub für Phase 1-3)
- Adjacency Lists, Erreichbarkeits-Prüfungen, Zyklen-Erkennung
Testing:
- 22 Unit-Tests (alle bestanden): Graph-Parsing, Validierung, Topologische Sortierung
- Fixtures: simple_valid_graph, parallel_graph, branching_graph
Version:
- APP_VERSION 0.9i
- DB_SCHEMA_VERSION 20260403
- Module: workflow 0.1.0
Anforderungsanalyse: .claude/task/Workflow_engine_prompting_engine/anforderungsanalyse_umsetzungsplan.md
Konzept-Basis: .claude/task/Workflow_engine_prompting_engine/konzept_workflow_engine_konsolidated.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 16:55:51 +02:00
c04e72a397
fix: Placeholder Catalog nutzt Registry als Single Source of Truth
...
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
Problem:
- get_placeholder_catalog() hatte hardcodierte Liste (Körper: 11, Ernährung: 8, Training: 9)
- Registry hat vollständige Cluster (Körper: 17, Ernährung: 14, Aktivität: 17)
- Export zeigte unvollständige Placeholder-Zählungen
Lösung:
- get_placeholder_catalog() nutzt jetzt get_registry() als primäre Quelle
- Fallback auf Legacy-Liste nur für nicht-registrierte Placeholder
- Automatisch aktuell bei neuen Registry-Einträgen
Betroffen:
- /api/prompts/placeholders/export-values (Settings Export)
- /api/prompts/placeholders/export-values-extended (Metadata Export)
- /api/prompts/execute (Prompt Test Debug-Export)
- /api/prompts/placeholders/catalog (Catalog Endpoint)
Erwartete Zahlen nach Deploy:
- Körper: 17 (statt 11)
- Ernährung: 14 (statt 8)
- Aktivität: 17 (statt 9)
- Total: ~70-75 Placeholder (48 Registry + Legacy)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 08:47:22 +02:00
10f608438c
Add tests for Activity Cluster registration and smoke tests for login functionality
...
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
- Implemented a new test script `test_activity_registration.py` to verify the registration of Activity placeholders, ensuring all expected placeholders are registered, have complete metadata, and correct evidence distribution.
- Created a new smoke test suite `dev-smoke-test.spec.js` to validate the login process, dashboard loading, and navigation to key sections, while checking for critical console errors.
- Added a JSON file `test-results.last-run.json` to track the status of the last test run, indicating failures if any tests do not pass.
2026-04-03 08:22:08 +02:00
485aec40a0
feat: Activity Cluster Placeholder Registry - Complete Implementation (17 Placeholders)
...
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
Implements complete placeholder registry for Activity & Training metrics following
Phase 0c Multi-Layer Architecture pattern.
SCOPE: 17 Activity Placeholders
- Group 1 (3): Legacy Resolver - activity_summary, activity_detail, trainingstyp_verteilung
- Group 2 (7): Basic Metrics - volume, frequency, quality, load, monotony, strain, rest compliance
- Group 3 (7): Advanced Metrics - 5x ability_balance, vo2max_trend, activity_score
IMPLEMENTATION:
- File: backend/placeholder_registrations/activity_metrics.py (~1,100 lines)
- Pattern: Nutrition Part A (common_metadata + evidence-based tagging)
- Evidence: CODE_DERIVED (58%), DRAFT_DERIVED (16%), MIXED (15%), TO_VERIFY (6%), UNRESOLVED (5%)
- Formulas: All documented in known_limitations (Load Model, Monotony, Strain, Ability Balance, Activity Score)
CRITICAL ISSUES IDENTIFIED (NOT FIXED per NO LOGIC CHANGES):
1. quality_label field mismatch (quality_sessions_pct) - TO_VERIFY
2. RPE moderate quality mapping bug (proxy_internal_load_7d) - CODE_DERIVED
3. JSONB dependencies (6 placeholders) - ability_balance_*, rest_day_compliance
4. vo2max_trend_28d questionable category (Recovery vs. Activity) - TO_VERIFY
TESTING:
✓ All 17 placeholders registered successfully
✓ Registry size: 48 (31 pre-existing + 17 new)
✓ Dev backend integration: no errors
✓ Auto-registration on module import: working
ARCHITECTURE ALIGNMENT:
- Phase 0c Multi-Layer: 14/17 aligned (Group 2 + 3)
- Old Resolver Pattern: 3/17 (Group 1 - documented, should be refactored)
- Layer separation: data_layer → resolver → export
FILES:
- NEW: backend/placeholder_registrations/activity_metrics.py
- MODIFIED: backend/placeholder_registrations/__init__.py (added import)
- MODIFIED: CLAUDE.md (placeholder registry rules)
DOCUMENTATION:
- Gap Analysis: .claude/task/rework_0b_placeholder/ACTIVITY_CLUSTER_GAP_ANALYSIS.md
- Code Inspection: .claude/task/rework_0b_placeholder/ACTIVITY_CLUSTER_CODE_INSPECTION.md
- Implementation Report: .claude/task/rework_0b_placeholder/ACTIVITY_CLUSTER_IMPLEMENTATION_REPORT.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 08:20:25 +02:00
57800b686a
fix: Body Cluster - PlaceholderType.TEXT_SUMMARY → INTERPRETED
...
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
- caliper_summary + circ_summary used invalid PlaceholderType.TEXT_SUMMARY
- TEXT_SUMMARY is OutputType, not PlaceholderType
- Changed to PlaceholderType.INTERPRETED (summaries interpret raw data)
Valid PlaceholderType values: ATOMIC, RAW_DATA, INTERPRETED, SCORE, META
Valid OutputType values: NUMERIC, STRING, BOOLEAN, JSON, LIST, TEXT_SUMMARY
2026-04-02 19:11:06 +02:00
fbaaf08e29
feat: Body Cluster - Placeholder Registry Implementation
...
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
Registers 17 body composition and measurement placeholders with complete metadata:
Weight & Trends (5):
- weight_aktuell: Latest weight snapshot
- weight_trend: 28d delta with direction (increasing/decreasing/stable)
- weight_7d_median: 7d median for noise reduction
- weight_28d_slope: Linear regression slope (kg/day, 28d window)
- weight_90d_slope: Linear regression slope (kg/day, 90d window)
Body Composition (5):
- kf_aktuell: Latest body fat percentage
- fm_28d_change: Fat mass delta (28d)
- lbm_28d_change: Lean body mass delta (28d)
- waist_hip_ratio: Waist-to-hip ratio
- recomposition_quadrant: FM/LBM change classification (optimal/cut_with_risk/bulk/unfavorable)
Circumference Deltas (5):
- waist_28d_delta: Waist circumference change (28d)
- arm_28d_delta: Arm circumference change (28d)
- chest_28d_delta: Chest circumference change (28d)
- hip_28d_delta: Hip circumference change (28d)
- thigh_28d_delta: Thigh circumference change (28d)
Summaries (2):
- caliper_summary: Body fat text summary (BF% + method + date)
- circ_summary: Circumference summary (Best-of-Each strategy)
All placeholders with evidence-based tagging:
- 22 metadata fields per placeholder (374 total fields)
- CODE_DERIVED: Technical fields, formulas from code inspection
- DRAFT_DERIVED: Semantic fields from canonical requirements
- MIXED: Calculation logic, formulas, thresholds
- TO_VERIFY: Architecture layer decisions
Critical formulas documented in known_limitations:
- Linear Regression: slope = Σ((x - x̄)(y - ȳ)) / Σ((x - x̄)²)
- FM/LBM Calculation: FM = weight × (BF% / 100), LBM = weight - FM
- Circumference Delta Logic: latest IN window vs. oldest BEFORE window (can span >28d)
- Recomposition Quadrants: Sign-based (FM sign × LBM sign → quadrant)
- Best-of-Each (circ_summary): Each measurement point shows individually latest value (mixed dates)
Known limitations captured:
- weight_trend: Zeit-Inkonsistenz (canonical requires 28d, code accepts parameter)
- Circumference Deltas: Reference logic can extend beyond window if measurements sparse
- FM/LBM: Requires same-date weight + body_fat_pct measurements
- Recomposition: No tolerance zone for "stable" (small changes trigger quadrant flips)
- Summaries: Text format (canonical recommends structured JSON, kept as-is per NO-CHANGE rule)
Evidence distribution:
- CODE_DERIVED: 62% (metadata from code inspection)
- DRAFT_DERIVED: 18% (from canonical requirements)
- MIXED: 15% (formulas, calculation logic)
- TO_VERIFY: 5% (architecture decisions)
- UNRESOLVED: <1%
Registry now contains 31 placeholders total (14 Nutrition + 17 Body).
Files:
- backend/placeholder_registrations/body_metrics.py (NEW, 1307 lines)
- backend/placeholder_registrations/__init__.py (UPDATED, +body_metrics import)
Framework: PLACEHOLDER_REGISTRY_FRAMEWORK.md (verbindlich ab 2026-04-02)
Change Plan: .claude/task/rework_0b_placeholder/BODY_CLUSTER_CHANGE_PLAN.md
Code Inspection: .claude/task/rework_0b_placeholder/BODY_CLUSTER_CODE_INSPECTION.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 18:57:15 +02:00
5bf8895fb3
fix: Nutrition Cluster Abschluss - Metadaten-Konsistenz
...
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Behebt letzte Inkonsistenzen im Export:
1. protein_g_per_kg:
- time_window: 'mixed' → '7d' (dominante Komponente)
- Kommentar angepasst: weight ist snapshot, aber protein (7d) ist primär
- known_limitations dokumentiert die Inkonsistenz weiterhin
2. protein_adequacy_28d:
- unit: 'score' → 'score (0-100)' (Konsistenz mit macro_consistency_score)
- Klarere Skalen-Angabe im Export
Finaler Export-Status: 14/14 Nutrition Placeholders konsistent
- Alle haben korrekte Category (Ernährung)
- Alle haben präzise Units
- Alle haben eindeutige Time Windows
- Alle haben korrekte Output Types
Abschlussarbeit für Ernährungs-Cluster.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:07:35 +02:00
ffdf9074c3
fix: Part C OutputType - use STRING instead of TEXT
...
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Fixed AttributeError: OutputType has no attribute TEXT.
Correct enum values are: NUMERIC, STRING, BOOLEAN, JSON, LIST, TEXT_SUMMARY.
Affected placeholders:
- energy_deficit_surplus: OutputType.STRING
- intake_volatility: OutputType.STRING
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:56:13 +02:00
ffb30eaff5
feat: Placeholder Registry Part C - Nutrition Consistency & Balance
...
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Has been cancelled
Registers 5 nutrition-related placeholders with complete metadata:
- macro_consistency_score: CV-based Makro-Konsistenz Score (0-100)
- energy_balance_7d: Energiebilanz (kcal/day avg, intake - TDEE)
- energy_deficit_surplus: Status (deficit/maintenance/surplus)
- intake_volatility: Klassifikation (stable/moderate/high)
- nutrition_days: Anzahl valider Ernährungstage (30d)
All placeholders with evidence-based tagging:
- 22 metadata fields per placeholder
- CODE_DERIVED: Technical fields, formulas from code inspection
- DRAFT_DERIVED: Semantic fields from canonical requirements
- MIXED: Calculation logic (TDEE model, thresholds, formulas)
- TO_VERIFY: Architecture layer decisions
Critical details documented:
- macro_consistency_score: CV formula + thresholds explicitly documented
- energy_balance_7d: TDEE model (weight_kg × 32.5), unit clarified (kcal/day avg)
- energy_deficit_surplus: Status thresholds (<-200, -200 to +200, >+200)
- intake_volatility: Category mapping from macro_consistency_score
- nutrition_days: Validation criteria (any entry = valid day)
Known limitations captured:
- TDEE model is simplified (no activity/age/gender adjustment)
- Thresholds are somewhat arbitrary (e.g., 200 kcal for deficit/surplus)
- High volatility not necessarily bad (context-dependent)
Registry now contains 14 placeholders total:
- Part A: 4 (kcal_avg, protein_avg, carb_avg, fat_avg)
- Part B: 5 (protein targets + adequacy)
- Part C: 5 (consistency + balance + meta)
Framework: PLACEHOLDER_REGISTRY_FRAMEWORK.md (verbindlich ab 2026-04-02)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:55:03 +02:00
0c19e0c0ed
fix: Part B protein placeholders - aggregate by date
...
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
Fixes calculate_protein_g_per_kg and calculate_protein_days_in_target:
**Problem:**
Both functions were treating individual nutrition_log entries as days,
causing incorrect calculations when multiple entries exist per day
(e.g., from CSV imports: 233 entries across 7 days).
**Solution:**
1. calculate_protein_g_per_kg:
- Added GROUP BY date, SUM(protein_g) to aggregate by day
- Now averages daily totals, not individual entries
- Correct: 7 days → 7 values, not 233 entries → 233 values
2. calculate_protein_days_in_target:
- Added GROUP BY date, SUM(protein_g) to aggregate by day
- Calculates target range in absolute grams (not g/kg per entry)
- Counts unique DAYS in range, not entries
- Correct format: "5/7" (5 of 7 days), not "150/233" (entries)
**Impact:**
- protein_g_per_kg: was returning "nicht verfügbar" → now returns correct value
- protein_days_in_target: was returning "nicht verfügbar" → now returns correct format
**Root Cause:**
Functions expected 7 unique dates but got 233 entries.
With export date 2026-04-02 and last data 2026-03-26,
the 7-day window had insufficient unique dates.
Issue reported by user: Part B placeholders not showing correct values
in extended export (registry metadata was correct, but computed values failed).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:43:33 +02:00
b00f6ac512
feat: Placeholder Registry Part B - Protein Placeholders
...
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
Registers 5 protein-related placeholders with complete metadata:
- protein_ziel_low: Lower protein target (1.6 g/kg × latest weight)
- protein_ziel_high: Upper protein target (2.2 g/kg × latest weight)
- protein_g_per_kg: Protein intake per kg body weight
- protein_days_in_target: Days in protein range (format: 5/7)
- protein_adequacy_28d: Protein adequacy score (0-100)
All placeholders with evidence-based tagging:
- 22 metadata fields per placeholder
- CODE_DERIVED: Technical fields from source inspection
- DRAFT_DERIVED: Semantic fields from canonical requirements
- UNRESOLVED: Fields requiring clarification
- TO_VERIFY: Assumptions needing verification
Critical issues documented in known_limitations:
- protein_g_per_kg: Weight basis inconsistency (protein 7d avg / weight latest)
- protein_adequacy_28d: Score logic explicitly documented (1.4-1.6-2.2 thresholds)
Registry now contains 9 placeholders total (4 Part A + 5 Part B).
Framework: PLACEHOLDER_REGISTRY_FRAMEWORK.md (verbindlich ab 2026-04-02)
Change Plan: .claude/task/rework_0b_placeholder/NUTRITION_PART_B_CHANGE_PLAN.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:27:58 +02:00
81681f0de3
fix: Handle missing TimeWindow enum in export endpoint
...
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
Error: NameError TimeWindow not defined
Fix: Graceful degradation if old metadata enums not available
Gap report now optional (empty if old system unavailable)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 11:54:02 +02:00
645967a2ab
feat: Placeholder Registry Framework + Part A Nutrition Metrics
...
Deploy Development / deploy (push) Successful in 51s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
Part A Implementation (Nutrition Basis Metrics):
- Registry-based metadata system (flexible, not hardcoded)
- 4 placeholders registered: kcal_avg, protein_avg, carb_avg, fat_avg
- Evidence-based tagging (code-derived, draft-derived, unresolved, to_verify)
- Single source of truth for all consumers (Prompt, GUI, Export, Validation)
Technical:
- backend/placeholder_registry.py: Core registry framework
- backend/placeholder_registrations/nutrition_part_a.py: Part A registrations
- backend/placeholder_registry_export.py: Export integration
- backend/routers/prompts.py: /placeholders/export-values-extended integration
Metadata completeness:
- 22 metadata fields per placeholder
- Evidence tracking for all fields
- Architecture alignment (Layer 1/2a/2b)
NO LOGIC CHANGE:
- Data Layer unchanged (nutrition_metrics.py)
- Resolver unchanged (placeholder_resolver.py)
- Values identical (only metadata/export enhanced)
Breaking Change Risk: NONE
Deploy Risk: VERY LOW (only export enhancement)
Plan: .claude/task/rework_0b_placeholder/NUTRITION_PART_A_CHANGE_PLAN.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 11:46:16 +02:00
6cdc159a94
fix: add missing Header import in prompts.py
...
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
NameError: name 'Header' is not defined
Added Header to fastapi imports for export endpoints auth fix.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 21:25:33 +02:00
650313347f
feat: Placeholder Metadata V2 - Normative Implementation + ZIP Export Fix
...
Deploy Development / deploy (push) Successful in 54s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 15s
MAJOR CHANGES:
- Enhanced metadata schema with 7 QA fields
- Deterministic derivation logic (no guessing)
- Conservative inference (prefer unknown over wrong)
- Real source tracking (skip safe wrappers)
- Legacy mismatch detection
- Activity quality filter policies
- Completeness scoring (0-100)
- Unresolved fields tracking
- Fixed ZIP/JSON export auth (query param support)
FILES CHANGED:
- backend/placeholder_metadata.py (schema extended)
- backend/placeholder_metadata_enhanced.py (NEW, 418 lines)
- backend/generate_complete_metadata_v2.py (NEW, 334 lines)
- backend/tests/test_placeholder_metadata_v2.py (NEW, 302 lines)
- backend/routers/prompts.py (V2 integration + auth fix)
- docs/PLACEHOLDER_METADATA_VALIDATION.md (NEW, 541 lines)
PROBLEMS FIXED:
✓ value_raw extraction (type-aware, JSON parsing)
✓ Units for dimensionless values (scores, correlations)
✓ Safe wrappers as sources (now skipped)
✓ Time window guessing (confidence flags)
✓ Legacy inconsistencies (marked with flag)
✓ Missing quality filters (activity placeholders)
✓ No completeness metric (0-100 score)
✓ Orphaned placeholders (tracked)
✓ Unresolved fields (explicit list)
✓ ZIP/JSON export auth (query token support for downloads)
AUTH FIX:
- export-catalog-zip now accepts token via query param (?token=xxx)
- export-values-extended now accepts token via query param
- Allows browser downloads without custom headers
Konzept: docs/PLACEHOLDER_METADATA_REQUIREMENTS_V2_NORMATIVE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 21:23:37 +02:00
087e8dd885
feat: Add Placeholder Metadata Export to Admin Panel
...
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 19s
Adds download functionality for complete placeholder metadata catalog.
Backend:
- Fix: None-template handling in placeholder_metadata_extractor.py
- Prevents TypeError when template is None in ai_prompts
- New endpoint: GET /api/prompts/placeholders/export-catalog-zip
- Generates ZIP with 4 files: JSON catalog, Markdown catalog, Gap Report, Export Spec
- Admin-only endpoint with on-the-fly generation
- Returns streaming ZIP download
Frontend:
- Admin Panel: New "Placeholder Metadata Export" section
- Button: "Complete JSON exportieren" - Downloads extended JSON
- Button: "Complete ZIP" - Downloads all 4 catalog files as ZIP
- Displays file descriptions
- api.js: Added exportPlaceholdersExtendedJson() function
Features:
- Non-breaking: Existing endpoints unchanged
- In-memory ZIP generation (no temp files)
- Formatted filenames with date
- Admin-only access for ZIP download
- JSON download available for all authenticated users
Use Cases:
- Backup/archiving of placeholder metadata
- Offline documentation access
- Import into other tools
- Compliance reporting
Files in ZIP:
1. PLACEHOLDER_CATALOG_EXTENDED.json - Machine-readable metadata
2. PLACEHOLDER_CATALOG_EXTENDED.md - Human-readable catalog
3. PLACEHOLDER_GAP_REPORT.md - Unresolved fields analysis
4. PLACEHOLDER_EXPORT_SPEC.md - API specification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:37:52 +02:00
b7afa98639
docs: Add placeholder metadata deployment guide
...
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:33:46 +02:00
a04e7cc042
feat: Complete Placeholder Metadata System (Normative Standard v1.0.0)
...
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s
Implements comprehensive metadata system for all 116 placeholders according to
PLACEHOLDER_METADATA_REQUIREMENTS_V2_NORMATIVE standard.
Backend:
- placeholder_metadata.py: Complete schema (PlaceholderMetadata, Registry, Validation)
- placeholder_metadata_extractor.py: Automatic extraction with heuristics
- placeholder_metadata_complete.py: Hand-curated metadata for all 116 placeholders
- generate_complete_metadata.py: Metadata generation with manual corrections
- generate_placeholder_catalog.py: Documentation generator (4 output files)
- routers/prompts.py: New extended export endpoint (non-breaking)
- tests/test_placeholder_metadata.py: Comprehensive test suite
Documentation:
- PLACEHOLDER_GOVERNANCE.md: Mandatory governance guidelines
- PLACEHOLDER_METADATA_IMPLEMENTATION_SUMMARY.md: Complete implementation docs
Features:
- Normative compliant metadata for all 116 placeholders
- Non-breaking extended export API endpoint
- Automatic + manual metadata curation
- Validation framework with error/warning levels
- Gap reporting for unresolved fields
- Catalog generator (JSON, Markdown, Gap Report, Export Spec)
- Test suite (20+ tests)
- Governance rules for future placeholders
API:
- GET /api/prompts/placeholders/export-values-extended (NEW)
- GET /api/prompts/placeholders/export-values (unchanged, backward compatible)
Architecture:
- PlaceholderType enum: atomic, raw_data, interpreted, legacy_unknown
- TimeWindow enum: latest, 7d, 14d, 28d, 30d, 90d, custom, mixed, unknown
- OutputType enum: string, number, integer, boolean, json, markdown, date, enum
- Complete source tracking (resolver, data_layer, tables)
- Runtime value resolution
- Usage tracking (prompts, pipelines, charts)
Statistics:
- 6 new Python modules (~2500+ lines)
- 1 modified module (extended)
- 2 new documentation files
- 4 generated documentation files (to be created in Docker)
- 20+ test cases
- 116 placeholders inventoried
Next Steps:
1. Run in Docker: python /app/generate_placeholder_catalog.py
2. Test extended export endpoint
3. Verify all 116 placeholders have complete metadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:32:37 +02:00
c21a624a50
fix: E2 protein-adequacy endpoint - undefined variable 'values' -> 'daily_values'
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 14s
2026-03-29 07:38:04 +02:00